Re: Trying to make ntpdate run on boot

2,444 views
Skip to first unread message

Juanjo

unread,
May 22, 2013, 9:41:55 PM5/22/13
to beagl...@googlegroups.com
On my little experience on Angstrom, the particular default network configuration for the image "systemd" actually does not uses ifup/ifdown scripts. Instead by default eth0 is govern by connman. So maybe you have to tweak that config files.

On Wednesday, May 22, 2013 8:53:07 PM UTC-4, fnj...@gmail.com wrote:
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.

It appears there is an effort to make this happen built into Angstrom, via a symlink ntpdate-sync in /etc/network/if-up.d. I put my vicim ntp servers in /etc/default/ntpdate. But the desired effect is not obtained. The date is never set, and stays stuck on stupid with the year defaulting to 2000. I tried writing a replacement for the script in /etc/network/if-up.d, and my replacement doesn't work either. In fact, nothing I try to do in my script seems to happen.

If I run ntpdate-sync by hand, it works fine. And here is the kicker. If I run ifup eth0, it works fine too. But if I just cold boot, it does not work.

It's as if the scripts that ifup runs never get run on boot - i.e., the network is coming up through some mechanism other than ifup. Is this so, and if so, WHY OH WHY is it so?

Angstrom bug? Not a bug because XXX? What's the deal?

Koen Kooi

unread,
May 23, 2013, 2:39:06 AM5/23/13
to beagl...@googlegroups.com, beagl...@googlegroups.com


Op 23 mei 2013 om 03:41 heeft Juanjo <sier...@gmail.com> het volgende geschreven:

On my little experience on Angstrom, the particular default network configuration for the image "systemd"

systemd has nothing to do with networking


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bikoz

unread,
May 23, 2013, 6:00:35 AM5/23/13
to beagl...@googlegroups.com


Il giorno giovedì 23 maggio 2013 02:53:07 UTC+2, fnj...@gmail.com ha scritto:
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:
It works with recent connmans.
/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

Sid Boyce

unread,
May 23, 2013, 6:19:19 AM5/23/13
to beagl...@googlegroups.com
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.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support
Senior Staff Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

KurtE

unread,
May 23, 2013, 9:37:08 AM5/23/13
to beagl...@googlegroups.com, sbo...@blueyonder.co.uk
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 <LINK>
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 192.168.2.1 gw 0.0.0.0 scope 253 <LINK>
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 8.8.8.8 gw 192.168.2.1 scope 0 <UNIVERSE>
Dec 31 16:00:11 beaglebone connmand[130]: eth0 {add} route 0.0.0.0 gw 192.168.2.1 scope 0 <UNIVERSE>
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

cmicali

unread,
May 23, 2013, 2:37:27 PM5/23/13
to beagl...@googlegroups.com
Following these instructions worked great for me:



On Wednesday, May 22, 2013 8:53:07 PM UTC-4, fnj...@gmail.com wrote:
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.

Juanjo

unread,
May 23, 2013, 3:10:10 PM5/23/13
to beagl...@googlegroups.com
On my little experience on Angstrom, the particular default network configuration for the image "systemd"

systemd has nothing to do with networking


That's why I said "systemd" image, as the systemd config for Angstrom/OE which is used to make a systemd based OE/Angstrom build. Again I´m not Angstrom/OE savvy so surely my wording isn't the best mixing image/build/etc. But I didn't said anywhere that systemd is governing networking just that connman is governing the networking on this particular Angstrom build.

But being one of the maintainers a better clarification of what is governing eth0 by default is welcome :)

Pedro A. Melendez

unread,
May 23, 2013, 4:44:26 PM5/23/13
to beagl...@googlegroups.com
you can simply set a cron every hour with ntpdate, or use ntpd, and of course you will need to chance the localtime file for your timezone



On Thu, May 23, 2013 at 2:57 PM, <pmid...@gmail.com> wrote:
Be aware that ntpdate will no longer function after doing this so you want to remove the cronjob and remove the script under /etc/network/if-up.d . 

Micka

unread,
May 23, 2013, 4:53:47 PM5/23/13
to beagl...@googlegroups.com
by the way the new release of may is doing it automatically ;)

Pedro A. Melendez

unread,
May 24, 2013, 2:09:44 PM5/24/13
to beagl...@googlegroups.com
nice good to know :)

Simon Platten

unread,
Jun 2, 2013, 3:20:29 AM6/2/13
to beagl...@googlegroups.com
The important command once you have set-up the correct timezone is:

/usr/lib/connman/test/set-global-timeservers pool.ntp.org

This will ensure that when the BBB is reset it knows where to go to get the time / date update.

Also the default timezone in my set-up was UTC.  I always stick to UTC despite seasonable changes because of the effect it can have it you are using the time and date for logging purposes, if you are logging and suddenly clocks go forward an hour as they do for british summer time or back an hour at the end of british summer time, it completely screws up data logs.
Reply all
Reply to author
Forward
0 new messages