ntp not working.

I'm trying to get ntp working. I've tried the suggestions in the default file /etc/ntp.conf and i've also tried adding ntp pool servers from the net, nothing works.

no matter what server i add, i get this error:

Code:
Error:  hostname nor servername provided, or unknown.

am i missing something?

i do have ntpdate_enable="YES" in my /etc/rc.conf


could this be because i use wireless?

I'm running FreeBSD 8.0 rc1

thanks
 
Uh... ntpd_enable and ntpdate_enable aren't the same. The NTP daemon syncs the clock using a more gradual approach while ntpdate syncs it immediately. The command ntpdate can't be run while the NTP daemon is enabled.

To use the NTP daemon, put ntpd_enable="YES" in /etc/rc.conf and configure /etc/ntp.conf.

As for ntpdate, try (remember to change the server)
Code:
ntpdate_enable="YES"
ntpdate_flags="-b time.stdtime.gov.tw"
 
i was following this from the handbook
anyways, i figured out the problem but i don't know how to solve it.

It needs to be delayed until after the wifi comes up. If i do /etc/rc.d/ntpdate restart it syncs

i will check out what you said and see if it helps thought
 
I'm not really familiar with WiFi, but $ rcorder /etc/rc.d/* should show the order the startup scripts are executed. Check and see if ntpdate is behind WiFi.
 
i disabled ntpdate, and set up ntpd like you said but now i get this error:

Code:
Frequency format error in /var/db/ntpd.drift
 
Just let it run for a while. The drift file is probably not populated on start-up of ntpd, so it considers the (lack of) information in it as an error. After a while, you should see a time offset (like -2.045) showing up there.
 
According to rcorder, ntpdate runs before wpa_supplicant, which means it will run (and fail) before the wireless link is up.

You'll want to edit /etc/rc.d/ntpdate and add "wpa_supplicant" to the REQUIRE line.

/etc/rc.d/ntpd REQUIREs ntpdate, so getting ntpdate to run after wpa_supplicant should get things working at boot.
 
I'd also add that if this is on a laptop (I'm presuming that because of the wireless - I could be wrong), then this might be a good candidate for using the ntpd -q option.

What I am getting at is if you're turning it off and on all the time, I don't see a good reason to have the ntpd daemon running in the background. Instead, just sync up once at boot time (after fixing the rc order).
 
it's working now.

It is a laptop but i do leave it on for long periods of time, the only reason i've been rebooting it lately is to make sure things were starting at boot like i want.


I've got one more issue to work out with it, but everything is is working nicely at this time.

Thanks for the help guys
 
Back
Top