Comment 42 for bug 114505

Revision history for this message
cwsupport (netsupport) wrote : Re: [Bug 114505] Re: ntp brought up before network is ready; fails not resolve any ip or host names; ntp does not recover

Hi,

I disagree with this diagnosis..

S28NetworkManager is a red-herring. For a start Hardy doesnt have
this...Looking at the startup for Hardy:

S15bind9
S16openvpn
S16ssh
S17mysql-ndb-mgm
S17portmap
S18avahi-daemon
S18mysql-ndb
S19mysql
S20apmd
S20apport
S20cupsys
S20cyrus2.2
S20exim4
S20hotkey-setup
S20jboss
S20nfs-common
S20nfs-kernel-server
S20nvidia-kernel
S20powernowd
S20rsync
S20samba
S20saslauthd
S20ser2net
S20winbind
S20xl2tpd
S23ntp

As you can see S23ntp is up WAY after bind9. DNS clients resolving using
gethostbyname() only need the network up - and on worst case (i.e. my
machine with a caching DNS server) it needs to be up after S15bind9. It
seems to me the problem is that NTP is run before the *network* cards
are brought up properly (certainly before eth0). By the time it hits
S23ntp the damage was already done a long time before.

Resolution is based around /etc/nsswitch.conf, /etc/hosts and
/etc/resolv.conf. As it happens I am running caching DNS servers (bind9)
on all these machines as well - to fail to obtain the host that means
NTP is being executed PRIOR to S15bind9.

Now I have to say...the situation with the NTP daemon is a farce and
there have been so many people 'tampering' with NTPD startup that quite
frankly the use of /etc/rc2.d scripts is being completely undermined.
What is needed is a proper solution here rather than yet more tampering.
The NTP daemon is being started already from around 3 different places.
It is the ordering and interaction of these which is causing the
problems - coupled with the fact that the NTP daemon itself does not
perform any kind of retry-recovery internally.

Thomas wrote:
> I just finished a fresh U8.10-rc install.
> Plain vanilla, all I added was the NTP package.
>
> sprinkmeier@u810:~$ ls -l /etc/rc5.d/S2[38]*
> lrwxrwxrwx 1 root root 13 Oct 26 14:18 /etc/rc5.d/S23ntp -> ../init.d/ntp
> lrwxrwxrwx 1 root root 24 Oct 26 10:10 /etc/rc5.d/S28NetworkManager -> ../init.d/NetworkManager
>
> NTP starts before Network Manager, meaning that NTP won't have DNS available at startup.
> It tends to work, but moving NTP's startup after Network Managers should make it more reliable. It will also allow NTPDATE to run (it's called from the ip-up scripts, but will fail as NTPD will already own the socket).
>
> sprinkmeier@u810:~$ grep ntp-server /etc/dhcp3/dhclient.conf
> sprinkmeier@u810:~$
>
> NTP servers still aren't requested by default. If whoever set up your
> DHCP server knows enought to advertise NTP server(s) then chances are
> you should use them (or at the very least PREPEND them).
>
>

--
Sincerely Yours

Copyright Witness Net Support
<email address hidden>

www.copyrightwitness.com
Registration centre for copyright works.

This e-mail and any attachments are confidential and intended for the addressee only.
The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only.