[pkg-ntp-maintainers] Bug#408219: Bug#408219: ntpd giving up on eth0 before it is initialized
Thomas Fritz
Thomas.Fritz at bam.de
Sun Jun 17 18:53:38 UTC 2007
I ran into the same problem. Here some more information.
On startup (boot process) of my Debian/Etch dhcp/ntp clients, the hook
/etc/dhcp3/dhclient-enter-hooks.d/ntp
gets called, (re)starting ntpd at a point in time (DHCP BOUND), when the
network is not configured yet. Some seconds later the init script
/etc/init.d/ntp
attempts to start ntpd, but the start-stop-daemon just exits, since ntpd
is already running. Hence, ntpd stays in an offline state as Erik
explained.
On shutdown of the clients, the script
/etc/init.d/ntp
stops ntpd, but it is (re)started again by the hook
/etc/dhcp3/dhclient-enter-hooks.d/ntp
some seconds later (DHCP RELEASE). Then the systems gets down.
This can be worked around by replacing the line
invoke-rc.d ntp restart
with
invoke-rc.d ntp try-restart
in function 'ntp_server_restart()' of the hook.
Now, when the hook is called on startup/shutdown it does not
(needlessly) start ntpd anymore, and the startup/shutdown behaviour is
controlled by the init scripts alone.
The general problem, however, remains. I.e., when restarting the network
on the client:
# /etc/init.d/networking restart
Reconfiguring network interfaces...
There is already a pid file /var/run/dhclient.eth0.pid with pid 1687
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth0/00:14:bf:65:ad:b5
Sending on LPF/eth0/00:14:bf:65:ad:b5
Sending on Socket/fallback
DHCPRELEASE on eth0 to 172.20.1.6 port 67
Stopping NTP server: ntpd.
Starting NTP server: ntpd.
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth0/00:14:bf:65:ad:b5
Sending on LPF/eth0/00:14:bf:65:ad:b5
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 172.20.1.6
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 172.20.1.6
Stopping NTP server: ntpd.
Starting NTP server: ntpd.
bound to 172.20.1.9 -- renewal in 237 seconds.
done.
then ntpd is left offline by the second stop/start of the NTP server,
because the network interface is not configured at that point.
More information about the pkg-ntp-maintainers
mailing list