Re: executing ntpdate on boot - seems it doesn't work




On Feb 17, 2007, at 5:34 PM, Franck Joncourt wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rolf Bode-Meyer wrote:
Hi!

Hi,

I currently try to figure out if ntpdate is called on boottime in my
system or not.

It *should* be called when the network interfaces come up (ifup),
therefore the /etc/network/if-up.d/ntpdate is present. And it's indeed
called when I manually call ifup -a after booting--an entry in the
syslog then shows something like "adjust time server ... offset ...".
But I don't see such a syslog entry for boottime, so I fear there's
something wrong. Any ideas what that could be or how to be sure
everything is ok?


If it manually works, maybe you can add more lines to your
/etc/network/if-up/ntpdate file in order to track down where the
probleme comes from.

Try turning on bootlogd (change "No" to "Yes" in /etc/default/ bootlogd). That will copy everything that goes onto the console (from the "S05" point on in rsS.d) into /var/log/boot .





And another oddity: ifup is called by the network script which is
rcS.d/S40networking. So if everything works well, ntpdate sets the
system clock at S40. But *after* that S50hwclock.sh calls hwclock
--hctosys which sets the system clock to the hardware clock.
So doesn't hwclock needs to be called before ntpdate?


According to me you are right, hwclock should be start before ntpdate,
since ntpdate sets the system clock, and as you said, hwclock sets the
hardware clock from the system clock. It would be odd to do it in a
different way. I have checked my rcS.d directory, and I have :
S11hwclock and S40networking.

That's (S11hwclock.sh) where hwclock gets called on my Etch test machine too. I have no S50hwclock.sh on that machine.

But I *do* have S18hwclockfirst.sh *and* S50hwclock in /etc/rcS.d on my Sarge server. So, did you upgrade this machine from Sarge?


Actually, if you don't use dynamic networking (as on a laptop with WiFi and modems and such -- you can't tell where your next internet connection is coming from) then the current recommendation from the NTP maintainers is to use ntp, not ntpdate. The latest ntp included in Etch has the ability to sync the system clock quickly on reboot, thus making ntpdate unnecessary. The upstream NTP development group (Dave Mills et al) would like to have ntpdate go the way of the dodo- bird. The last remaining place where it's got a serious application is on machines with intermittent network connections.

Enjoy!

Rick



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Servers reachable, but cant sync
    ... Yet in -b mode, after communication with the server is complete, ntp decides for unexplained reasons ... and doesn't actually set the system clock. ... since ntpdate would go ahead and set the system clock with the ... to leave ntpd alone and not run ntpdate, ...
    (comp.protocols.time.ntp)
  • Re: executing ntpdate on boot - seems it doesnt work
    ... --hctosys which sets the system clock to the hardware clock. ... So doesn't hwclock needs to be called before ntpdate? ... connection is coming from) then the current recommendation from the NTP ...
    (Debian-User)
  • Re: NTP Daemon
    ... I believe it's now called just `ntp'. ... The functionality that used to be offered by ntpdate[*] has been subsumed into the ntp package by adding the "-g" option to the ntpd daemon. ... The ntpdate package will do a one-time adjustment at bootup, and the ntp-simple package will keep the clock in sync on a long-term basis after bootup. ... does a one-time adjustment of the system clock, usually at system startup --- that works regardless of how far off the system clock is. ...
    (Debian-User)
  • Re: ntp client over satellite and no CMOS battery
    ... There already is a mechanism to read the NTP status and statistics using the ntp_gettimeand ntp_adjtimesystem routines if your kernel has NTP support. ... make the ntpd starter script wait for a minute after starting ntpd, ... it comes alive from power cycle, the hwclock sets the system clock ... the network is available before the client ...
    (comp.protocols.time.ntp)
  • ntpd or ntpdate
    ... I ran ntpdate to set my system clock and I started ntpd to keep my system ... server ntp.ucsd.edu prefer ...
    (comp.unix.bsd.freebsd.misc)