Trying to make ntpdate run on boot

I’m using the Angstrom that came with my Beaglebone Black received today. I’m trying to get ntpdate to run and set the time via the network on boot.

Connman has a ntp client built in:

/usr/lib/connman/test/set-global-timeservers 0.europe.pool.ntp.org 1.europe.pool.ntp.org 2.europe.pool.ntp.org 3.europe.pool.ntp.org

It works with recent connmans.

If ntpd service is running it will automatically update the time on boot so there is no need to resort to ntpdate.
/usr/sbin/ntpd is part of the ntp package.
Regards
Sid.

I have started looking at the Journal information (journalctrl), to help debug why I can not get my wifi to work… And I think the issue with the date is that it is run before the network gets up and bails. I see some time stamps like:

journalctl -b

Dec 31 16:00:02 beaglebone /usr/sbin/crond[129]: (CRON) INFO (Syslog will be used instead of sendmail.): No such fi
Dec 31 16:00:03 beaglebone avahi-daemon[131]: Found user ‘avahi’ (UID 998) and group ‘avahi’ (GID 996).
Dec 31 16:00:03 beaglebone avahi-daemon[131]: Successfully dropped root privileges.
Dec 31 16:00:03 beaglebone avahi-daemon[131]: avahi-daemon 0.6.31 starting up.
Dec 31 16:00:04 beaglebone ntpdate[207]: Can’t find host us.pool.ntp.org: Name or service not known (-2)
Dec 31 16:00:04 beaglebone ntpdate[207]: no servers can be used, exiting
Dec 31 16:00:04 beaglebone connmand[130]: Connection Manager version 1.4

Then later the network responded and setup eth0… For example finally got an address…

Dec 31 16:00:11 beaglebone avahi-daemon[131]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.2.149.
Dec 31 16:00:11 beaglebone connmand[130]: Deleting host route failed (No such process)
Dec 31 16:00:11 beaglebone avahi-daemon[131]: New relevant interface eth0.IPv4 for mDNS.
Dec 31 16:00:11 beaglebone avahi-daemon[131]: Registering new address record for 192.168.2.149 on eth0.IPv4.
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} address 192.168.2.149/24 label eth0 family 2
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 192.168.2.0 gw 0.0.0.0 scope 253
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 192.168.2.1 gw 0.0.0.0 scope 253
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 8.8.8.8 gw 192.168.2.1 scope 0
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 0.0.0.0 gw 192.168.2.1 scope 0
Dec 31 16:00:11 beaglebone connmand[130]: Setting default gateway route failed (File exists)

The kludge I am doing, is on my root account, I updated my .bashrc file to add:
ntpdate-sync
Does not work if I wish to create another user and run it from there, but once I logon, this does finally update the date. Hopefully we will come up with a better solution as I would like to put this on a robot and hopefully not have to putty into it to set things up…

Kurt