Bug 57837 - tired of setting ntp server in two seperate files
tired of setting ntp server in two seperate files
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: ntp (Show other bugs)
7.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Brian Brock
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-26 23:36 EST by Jamie Zawinski
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-08 09:41:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jamie Zawinski 2001-12-26 23:36:32 EST
It's lame that I have to set my time server in both /etc/ntp.conf and
also in /etc/ntp/step-tickers.

Please apply this patch, which makes it so that if you don't have
a step-tickers file, it pulls the server names out of ntp.conf instead:

--- /etc/rc.d/init.d/ntpd	Wed Sep  5 03:54:42 2001
+++ /tmp/ntpd	Wed Dec 26 20:30:05 2001
@@ -19,17 +19,31 @@
 # Check that networking is up.
 [ ${NETWORKING} = "no" ] && exit 0
 
-[ -x /usr/sbin/ntpd -a -f /etc/ntp.conf ] || exit 0
+ntpconf=/etc/ntp.conf
+ntpstep=/etc/ntp/step-tickers
+
+[ -x /usr/sbin/ntpd -a -f $ntpconf ] || exit 0
 
 RETVAL=0
 prog="ntpd"
 
 start() {
 	# Adjust time to make life easy for ntpd
-	if [ -s /etc/ntp/step-tickers ]; then
+	tickers=''
+	if [ -s $ntpstep ]; then
+		tickers=`/bin/sed -e 's/#.*//' $ntpstep`
+        else
+		tickers=`/bin/sed \
+			-n -e 's/ *#.*//' -e 's/server  *\(.*\)/\1/p' \
+			$ntpconf`
+        fi
+tickers=''
+        if [ -z "$tickers" ]; then
+		echo $"No servers in $ntpconf or $ntpstep"
+        else
 		echo -n $"Synchronizing with time server: "
-		/usr/sbin/ntpdate -s -b -p 8 -u \
-		    `/bin/sed -e 's/#.*//' /etc/ntp/step-tickers`
+		/usr/sbin/ntpdate -s -b -p 8 -u $tickers
 		success
 		echo
 	fi


(BTW, there is no manual page for ntpdate, and "ntpdate -help"
doesn't mention the "-u" option that you use.)
Comment 1 Harald Hoyer 2002-01-08 09:40:55 EST
you are right ... thx, for your support... will integrate that ;)

ru
harald
Comment 2 Harald Hoyer 2002-01-29 05:24:06 EST
fixed in 4.1.0b-5

Note You need to log in before you can comment on or make changes to this bug.