Red Hat Bugzilla – Bug 46464
/etc/rc.d/init.d/ntpd chkconfig line starts too early
Last modified: 2007-04-18 12:34:18 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5 i686)
Description of problem:
/etc/rc.d/init.d/ntpd chkconfig line start level = 26 too early, before
named = 55 if using 'ntpdate' to pre-adjust clock. Since it is legal to use
dns names for servers listed in /etc/ntp/step-tickers, startup should be
delayed until after named.
Steps to Reproduce:
1. Enter hostname NOT in /etc/hosts of a ntp server in
/etc/ntp/step-tickers (create file if needed)
2. as root: kill named
3. as root: execute /etc/rc.d/init.d/ntpd start
check /var/log/messages for host lookup error & ntpdate failure
Actual Results: Jun 27 19:38:09 thalia ntpdate: can't find host
Jun 27 19:38:09 thalia ntpdate: no servers can be used, exiting
Initial time synch fails causing some difficulty when ntp tries to make up
for possible large time differences between local clock and remote server.
Expected Results: Jun 27 20:05:02 thalia ntpdate: step time server
22.214.171.124 offset -0.000024 sec
*** Bug 44580 has been marked as a duplicate of this bug. ***
should be fixed in ntp-4.1.0b-1
The solution I use for this is this:
1) Create two /etc/resolv.conf files, I call them /etc/resolv.conf_local_down and /etc/resolv.conf_local_up.
The only difference between them is that one /etc/resolv.conf_local_up uses 127.0.0.1 as a name server
and /etc/resolv.conf_local_down uses a nearby public name server.
2) Edit /etc/rc.d/init.d/named to move the proper /etc/resolv_conf.XXX to /etc/resolv.conf when the name
server is started or stopped. Here's the diff to /etc/rc.d/init.d/named from bind-9.2.0-1
--- named.FCS Mon Nov 26 15:32:40 2001
+++ named Sat Dec 1 11:26:32 2001
@@ -49,6 +49,7 @@
[ $RETVAL -ne 0 ] && failure $"$base startup"
+ [ $RETVAL -eq 0 ] && cat /etc/resolv.conf_local_up > /etc/resolv.conf
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/named && success $"$base startup"
@@ -56,6 +57,7 @@
# Stop daemons.
echo -n $"Stopping $prog: "
+ cat /etc/resolv.conf_local_down > /etc/resolv.conf
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named
*** Bug 66161 has been marked as a duplicate of this bug. ***
*** Bug 72128 has been marked as a duplicate of this bug. ***