Bug 114487 - NTP suggested enhancement
Summary: NTP suggested enhancement
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ntp
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-28 17:19 UTC by Clifford Perry
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-22 14:29:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Clifford Perry 2004-01-28 17:19:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2)
Gecko/20030708

Description of problem:
Background:
the ntp package version has increased recently to 4.1.2 and shipped
with an ntp.conf file with different options to before. Basicly now
the ntp.conf file has line
restrict default ignore
and
restrict 127.0.0.1

typically you could add:
server my-time-server.example.net

and it would work, now you need to resolve the IP address of the
'my-time-server.example.net' and then add into the ntp.conf file:

restrict ip-of-my-time-server mask 255.255.255.255 nomodify

this will then allow the ntpd running to sync/correct time as needed
against my-time-server.example.net. 

Since one of the main Ideas of DNS is to allow hostnames to resolve to
difference IP's seemlessly, this has a high chance to break should
'my-time-server.example.net' IP address change, requiring you to login
and fix all the systems you admin to this new IP (not much fun). 

As such, I have an initial solution/enhancement to get arround this issue:

- Add within /etc/sysconfig/ntp line:
NTPSERVER=my-time-server.example.net

- Add within /etc/rc.d/init.d/ntpd lines:

            OPTIONS="$OPTIONS -g"
        fi

       #Force system adjustment from time server.
       /usr/bin/logger -t ntpd "From /etc/sysconfig/ntp - using
$NTPSERVER"
       /usr/sbin/ntpdate -o 1 $NTPSERVER 1>/dev/null 2>&1
       
       #Check to see if IP for $NTPSERVER is set within /etc/ntp.conf 
       # to allow time syncs for ntpd.
       NTPSERVERIP=`dig +short $NTPSERVER| sed -n 2p`
       if grep "^restrict $NTPSERVERIP" /etc/ntp.conf > /dev/null
       then
               /usr/bin/logger -t ntpd "File /etc/ntp.conf configured
for $NTPSERVER's IP address of $NTPSERVERIP"
       else
               /usr/bin/logger -t ntpd "Adding $NTPSERVERIP into
/etc/ntp.conf file for $NTPSERVER"
               NTPTMPFILE=/tmp/ntp.$$
               if [ -s /etc/ntp.conf.orig ]
               then
                       mv /etc/ntp.conf.orig /etc/ntp.conf.orig.1
               fi
               sed "1s/^/#Allowing $NTPSERVERIP for
$NTPSERVER\nrestrict $NTPSERVERIP mask 255.255.255.255 nomodify\n/"
/etc/ntp.conf > $NTPTMPFILE
               if [ -s $NTPTMPFILE ] 
               then
                       mv /etc/ntp.conf /etc/ntp.conf.org
                       mv $NTPTMPFILE /etc/ntp.conf
               fi
       fi

         # Start daemons.
         echo -n $"Starting $prog: "


I could have added a section to add the "server
my-time-server.example.net" within ntp.conf within the script, but
this is a one time deal/addition which wouldnt change (unlike the IP
it resolves to). Of course this is just a suggested ideal/solution -
but figured you may be interested.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1..
2.
3.
    

Additional info:

Comment 1 Suzanne Hillman 2004-02-02 18:54:17 UTC
Internal RFE bug #114776 entered. Will be considered for future releases.

Comment 2 Suzanne Hillman 2004-04-22 14:29:39 UTC
Thank you for the suggestion. It was passed along to product
management, but not committed for a future release.


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