Possible boot ordering problem between ntp and dhcp
I think I'm seeing an ordering problem in that ntp won't set the system clock on boot because: 1) Yast stores the time server's name and not its IP address in /etc/ntp.conf 2) My system gets its IP via dhcpd 3) ntp fails to resolve the IP address via DNS for the ntp server named in /etc/ntp.conf because ... 4) dhcpd does not modify /etc/resolv.conf until *after* /etc/init.d/ntp is run FWIW: I've eth0 controlled by ifplugd. I believe that this is demonstrated by doing: egrep -i 'dhcp|ntp' /var/log/messages which yields the following: --- Nov 3 15:20:20 tornado ntpdate[5292]: can't find host louie.udel.edu Nov 3 15:20:20 tornado ntpdate[5292]: no servers can be used, exiting Nov 3 15:20:20 tornado ntpd[5365]: ntpd 4.2.0a@1.1191-r Fri Sep 9 17:17:17 UTC 2005 (1) Nov 3 15:20:21 tornado ntpd[5365]: precision = 3.000 usec Nov 3 15:20:21 tornado ntpd[5365]: Listening on interface wildcard, 0.0.0.0#123 Nov 3 15:20:21 tornado ntpd[5365]: Listening on interface wildcard, ::#123 Nov 3 15:20:21 tornado ntpd[5365]: Listening on interface lo, 127.0.0.1#123 Nov 3 15:20:21 tornado ntpd[5365]: kernel time sync status 0040 Nov 3 15:20:21 tornado ntpd[5365]: frequency initialized -1.291 PPM from /var/lib/ntp/drift/ntp.drift Nov 3 15:20:25 tornado modify_resolvconf: Service dhcpcd modified /etc/resolv.conf. See info block in this file --- showing /etc/resolv.conf being modified *after* ntp runs.
Hi, On Thursday, November 03, 2005 at 15:51:42, Bruce A. Mallett wrote:
I think I'm seeing an ordering problem in that ntp won't set the system clock on boot because: 1) Yast stores the time server's name and not its IP address in /etc/ntp.conf 2) My system gets its IP via dhcpd 3) ntp fails to resolve the IP address via DNS for the ntp server named in /etc/ntp.conf because ... 4) dhcpd does not modify /etc/resolv.conf until *after* /etc/init.d/ntp is run
FWIW: I've eth0 controlled by ifplugd.
Thats the "problem" (its not really a problem its your misunderstanding of ifplugd ;). The interface is up as soon as ifplugd is started. If you want to have ntp started/restarted after the interface is connected you need to do so in /etc/sysconfig/network/ifservices-<device description> Like $ cd /etc/sysconfig/network $ ls ifcfg-eth-id-00:0c:6e:4d:59:39 ifcfg-eth-id-00:0c:6e:4d:59:39 $ mkdir ifservices-eth-id-00:0c:6e:4d:59:39 $ cd ifservices-eth-id-00:0c:6e:4d:59:39 $ ln -s ../../init.d/ntp S10ntp $ ln -s ../../init.d/ntp K90ntp Henne -- Henne Vogelsang, Subsystems "Rules change. The Game remains the same." - Omar (The Wire)
Henne, Thank you very, very much for your detailed post. I followed your directions and it works like a charm! It was only as an after thought that I mentioned that I'd configured eth0 to use ifplugd .. good thing I did or I'd have lost out on your excellent post. :) I have the system configured to get the time from the ntp server on boot-up. Regardless of whether ifplugd is used or not it still strikes me as a problem in the boot-process to be trying to access the ntp server before the interface is configured. I guess my understanding of this is just too simplified. :( I would also think that ifplugd would be the default for non-wireless interfaces. - Bruce Henne Vogelsang wrote:
Hi,
On Thursday, November 03, 2005 at 15:51:42, Bruce A. Mallett wrote:
I think I'm seeing an ordering problem in that ntp won't set the system clock on boot because: 1) Yast stores the time server's name and not its IP address in /etc/ntp.conf 2) My system gets its IP via dhcpd 3) ntp fails to resolve the IP address via DNS for the ntp server named in /etc/ntp.conf because ... 4) dhcpd does not modify /etc/resolv.conf until *after* /etc/init.d/ntp is run
FWIW: I've eth0 controlled by ifplugd.
Thats the "problem" (its not really a problem its your misunderstanding of ifplugd ;). The interface is up as soon as ifplugd is started. If you want to have ntp started/restarted after the interface is connected you need to do so in /etc/sysconfig/network/ifservices-<device description>
Like
$ cd /etc/sysconfig/network $ ls ifcfg-eth-id-00:0c:6e:4d:59:39 ifcfg-eth-id-00:0c:6e:4d:59:39 $ mkdir ifservices-eth-id-00:0c:6e:4d:59:39 $ cd ifservices-eth-id-00:0c:6e:4d:59:39 $ ln -s ../../init.d/ntp S10ntp $ ln -s ../../init.d/ntp K90ntp
Henne
participants (2)
-
Bruce A. Mallett
-
Henne Vogelsang