Ubuntu nptdate can't find servers on boot

Using RCN’s 13.10

I know there was some discussion of related issues quite a while ago, but I’m not finding an answer. The servers listed are all the ones in /etc/ntp.conf.

Unless I set the date manually the BBB thinks it’s Feb. after any reboot. What might I be missing?

From syslog:

Feb 18 16:01:53 arm ntpdate[609]: Can’t find host pool.ntp.org: Name or service not known (-2)
Feb 18 16:01:54 arm ntpd[1162]: ntpd 4.2.6p5@1.2349-o Wed Oct 9 18:59:40 UTC 2013 (1)
Feb 18 16:01:54 arm ntpd[1165]: proto: precision = 0.958 usec
Feb 18 16:01:54 arm ntpd[1165]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Feb 18 16:01:54 arm ntpd[1165]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen and drop on 1 v6wildcard :: UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen normally on 2 lo 127.0.0.1 UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen normally on 3 eth0 192.168.20.205 UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen normally on 4 usb0 192.168.7.2 UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen normally on 5 eth0 fe80::1eba:8cff:fe95:1a UDP 123
Feb 18 16:01:54 arm ntpd[1165]: Listen normally on 6 lo ::1 UDP 123
Feb 18 16:01:54 arm ntpd[1165]: peers refreshed
Feb 18 16:01:54 arm ntpd[1165]: Listening on routing socket on fd #23 for interface updates
Feb 18 16:01:54 arm ntpd[1165]: Listening on routing socket on fd #23 for interface updates
Feb 18 16:01:55 arm kernel: [ 39.789811] c_can_platform 481d0000.d_can can0: setting BTR=1c0a BRPE=0001
Feb 18 16:01:55 arm kernel: [ 39.870525] can: controller area network core (rev 20120528 abi 9)
Feb 18 16:01:55 arm kernel: [ 39.870672] NET: Registered protocol family 29
Feb 18 16:01:55 arm kernel: [ 39.928294] can: raw protocol (rev 20120528)
Feb 18 16:02:13 arm ntpdate[609]: Can’t find host ca.pool.ntp.org: Name or service not known (-2)
Feb 18 16:02:14 arm ntpd[1165]: Deferring DNS for pool.ntp.org 1
Feb 18 16:02:33 arm ntpdate[609]: Can’t find host us.pool.ntp.org: Name or service not known (-2)
Feb 18 16:02:34 arm ntpd[1165]: Deferring DNS for ca.pool.ntp.org 1
Feb 18 16:02:53 arm ntpdate[609]: Can’t find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:02:54 arm ntpd[1165]: Deferring DNS for us.pool.ntp.org 1
Feb 18 16:03:13 arm ntpdate[609]: Can’t find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:03:14 arm ntpd[1165]: Deferring DNS for 0.ubuntu.pool.ntp.org 1
Feb 18 16:03:33 arm ntpdate[609]: Can’t find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:03:34 arm ntpd[1165]: Deferring DNS for 1.ubuntu.pool.ntp.org 1
Feb 18 16:03:53 arm ntpdate[609]: Can’t find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:03:54 arm ntpd[1165]: Deferring DNS for 2.ubuntu.pool.ntp.org 1
Feb 18 16:04:13 arm ntpdate[609]: Can’t find host ntp.ubuntu.com: Name or service not known (-2)
Feb 18 16:04:13 arm ntpdate[609]: no servers can be used, exiting
Feb 18 16:04:14 arm ntpd[1165]: Deferring DNS for 3.ubuntu.pool.ntp.org 1
Feb 18 16:04:34 arm ntpd[1165]: Deferring DNS for ntp.ubuntu.com 1
Feb 18 16:04:34 arm ntpd[1660]: signal_no_reset: signal 17 had flags 4000000
Feb 18 16:04:41 arm ntpd[1165]: ntpd exiting on signal 15
Feb 18 16:04:56 arm ntpd_intres[1660]: host name not found: pool.ntp.org
Feb 18 16:04:56 arm ntpd_intres[1660]: parent died before we finished, exiting
Feb 18 16:05:01 arm ntpdate[1696]: Can’t find host pool.ntp.org: Name or service not known (-2)
Feb 18 16:05:21 arm ntpdate[1696]: Can’t find host ca.pool.ntp.org: Name or service not known (-2)
Feb 18 16:05:41 arm ntpdate[1696]: Can’t find host us.pool.ntp.org: Name or service not known (-2)
Feb 18 16:06:01 arm ntpdate[1696]: Can’t find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:06:21 arm ntpdate[1696]: Can’t find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
Feb 18 16:06:41 arm ntpdate[1696]: Can’t find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)

ntpdate-debian behaves the same way. Specifying a server on the command line does not work either.

Solved! (Partly)

I’m on a Windows domain, and it has it’s own time server of course. That was blocking access to any external time servers. However, while I can now do ntpdate from the command line with the local time server ip specified, I have to kill ntp first since it is using the same socket. I think this issue have been discussed in the past and I can probably find the answer with enough googling, but if someone wants to share the recipe that would be great.

Adding the ip of the domain time server at the top of the ntp.conf server list was sufficient. All working now.

I think it's basically because ntpdate tries to connect to the NTP
servers before the BBB has got its ethernet up and running using DHCP.

On my BBB running Ubuntu 13.10 I saw the same errors in syslog but I
installed ntp (or was it ntpd) in addition and it seems to be able to
get the right time now - though there are still errors in syslog after
boot where ntpdate and ntp can't find the ntp servers.

On Debian, what I did was make an init script to add a route to out gateway/router, and then called ntpdate in the same script right after. With Debian, you can order when these scripts ( services ) are run so they can be run during whichever time you prefer during the boot up process. In my own case, I just ran the script/service at the end of the bootup process.

With all that said, Debian uses a different ( default ) system-v type init daemon than Ubuntu. Ubuntu uses Upstart, which as I understand is similar but different. I have done enough reading to realize that using Upstart on Ubuntu could be made to do the same thing, but I have no practical hands on personally

Anyway, this is just one way I have figured out to do this one thing. While most definitely it is not the only way, and possibly not even optimal. But it worked for me…