ntpd_enable="YES"
ntpdate_enable="YES"
gordon@ said:In FreeBSD, I recommend you use both ntpdate and ntpd. ntpdate will set the clock when you first boot so it's close enough that ntpd will work with it.
You can just add the following to /etc/rc.conf:
Code:ntpd_enable="YES" ntpdate_enable="YES"
Then read through /etc/ntp.conf. It's pretty well documented so it should be pretty obvious what to set.
#----------ntp config
ntpd_enable="YES"
ntpd_sync_on_start="YES"
Thanks, rbelk, that works for me. When I tried it the other way, it was giving me errors saying "hostname nor servname provided" and "cannot find host" or "cannot resolve host" or something along those lines. Now it's working fine.ntpd_enable="YES"
ntpd_sync_on_start="YES"
gilinko said:Or install openntpd from ports, which is much simpler and in my opinion works a lot better then the native ntpd daemon. No need to worry about stratum or anything else like that, just point it at a ntp server and let it go. However do use ntpdate to set the time and date on boot, to always have a good clock to start with.
Addtinker panic 0
to /etc/ntp.conf.
ntp.conf(5):Tried it, still required ntpd service restart
[...]
tinker [allan allan | dispersion dispersion | freq freq | huffpuff
huffpuff | panic panic | step step | stepback stepback |
stepfwd stepfwd | stepout stepout]
This command can be used to alter several system variables in
very exceptional circumstances. It should occur in the config-
uration file before any other configuration options.
tinker panic 0
does not work immediately after a wake up of the VM.files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null`
for _rc_elem in $files; do
debug "run_rc_script $_rc_elem resume"
run_rc_script $_rc_elem resume
done
ntpd_resume()
{
run_rc_command restart
}