Bug 46464

Summary: /etc/rc.d/init.d/ntpd chkconfig line starts too early
Product: [Retired] Red Hat Linux Reporter: Need Real Name <tom>
Component: ntpAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 7.1CC: blair, shishz
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-10-13 16:02:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-06-28 21:49:55 UTC
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.

How reproducible:
Always

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[472]: can't find host
ntp.visi.com
Jun 27 19:38:09 thalia ntpdate[472]: 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[893]: step time server
209.98.200.89 offset -0.000024 sec


Additional info:

Comment 1 Pekka Savola 2001-07-19 12:37:24 UTC
*** Bug 44580 has been marked as a duplicate of this bug. ***

Comment 2 Harald Hoyer 2001-12-14 13:28:10 UTC
should be fixed in ntp-4.1.0b-1


Comment 3 Blair Zajac 2001-12-15 22:25:32 UTC
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=1
        fi
        [ $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"
        echo
        return $RETVAL
@@ -56,6 +57,7 @@
 stop() {
         # Stop daemons.
         echo -n $"Stopping $prog: "
+       cat /etc/resolv.conf_local_down > /etc/resolv.conf
         killproc named
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named

Blair


Comment 4 Harald Hoyer 2002-06-11 14:06:35 UTC
*** Bug 66161 has been marked as a duplicate of this bug. ***

Comment 5 Harald Hoyer 2002-08-21 11:53:40 UTC
*** Bug 72128 has been marked as a duplicate of this bug. ***

Comment 6 Brian Brock 2003-10-13 16:02:11 UTC
fix verified.