This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 114487 - NTP suggested enhancement
NTP suggested enhancement
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ntp (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Brian Brock
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-28 12:19 EST by Clifford Perry
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 10:29:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Clifford Perry 2004-01-28 12:19:15 EST
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 13:54:17 EST
Internal RFE bug #114776 entered. Will be considered for future releases.
Comment 2 Suzanne Hillman 2004-04-22 10:29:39 EDT
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.