Bug 426749

Summary: An "-x" option in "/etc/sysconfig/ntpd" would be used contrariwise to what is indicated in the ntpd manpage
Product: Red Hat Enterprise Linux 4 Reporter: David Tonhofer <bughunt>
Component: ntpAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: low    
Version: 4.6   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-19 09:58:57 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:
Attachments:
Description Flags
Modified /etc/sysconfig/ntpd
none
Modified /etc/rc.d/init.d/ntpd script
none
Unified diff between RH ntpd script and mine none

Description David Tonhofer 2007-12-25 19:38:50 UTC
Description of problem:

The script "/etc/rc.d/init.d/ntpd" interpretes an "-x" found in the OPTIONS
parameter in "/etc/sysconfig/ntpd" as:

- Starting "ntpdate" before "npd" and thus stepping the clock if necessary (as
  opposed to just skewing the clock slowly to the correct value over a longer 
  period of time). 

Apart from the fact that the use of "ntpdate" is deprecated (as indicated in
the ntpdate man page), one would expect the "-x" option to be used as indicated
in the "ntpd" manpage -- as one would expect OPTIONS to be simpyl passed to 
ntpd. 

The "-x" option however means "do NOT step the clock - instead, skew it", 
which is exactly the contrary to what happens.

Thus I suggest the following:

Instead of using the "-x" option, add another argument to /etc/sysconfig/ntpd
to make things clear and use the "-x" as intended - as argument to "ntpd".

USE_NTPDATE="yes"

I shall add a patch for /etc/rc.d/init.d/ntpd and /etc/sysconfig/ntpd 
which use USE_NTPDATE. Also, the rc.d file has some additional comments.

Comment 1 David Tonhofer 2007-12-25 20:07:49 UTC
Created attachment 290380 [details]
Modified /etc/sysconfig/ntpd

Additional USE_NTPDATE and comments

Comment 2 David Tonhofer 2007-12-25 20:08:59 UTC
Created attachment 290381 [details]
Modified /etc/rc.d/init.d/ntpd script

Comment 3 David Tonhofer 2007-12-25 20:10:17 UTC
Created attachment 290382 [details]
Unified diff between RH ntpd script and mine

Comment 4 David Tonhofer 2007-12-26 00:37:16 UTC
Comment on attachment 290380 [details]
Modified /etc/sysconfig/ntpd

# OPTIONS are passed to ntpd as is.
# Drop root to id 'ntp' by default. ntpd uses the primary
# group of the indicated user. 
# The "-x" indicates that ntpd will always skew the clock.
# Replace "-x" by "-g -q" to implement the step-and-exit ntpdate behaviour.

OPTIONS="-u ntp -x -p /var/run/ntpd.pid"

# Use the (deprecated) ntpdate to step the clock to a correct 
# value before running "ntpd"
USE_NTPDATE=no

# Set to 'yes' to sync hw clock after a successful "ntpdate"
# execution (only used if USE_NTPDATE=yes)
SYNC_HWCLOCK=no

Comment 5 Miroslav Lichvar 2008-01-02 14:42:14 UTC
Users generally want to run ntpdate or have -g in ntpd options when -x is used
as it takes 2000 seconds to correct one second and the offset can be very large
before ntpd is running.

While I agree it's not very nice to modify the options before they are passed to
ntpd, it's too late in RHEL4 life to make incompatible changes like you have
proposed in the patch.

A possibility is to add another setting to sysconfig/ntpd so -x will be ignored
in the script. Would that be ok?

Comment 6 Miroslav Lichvar 2010-03-19 09:58:57 UTC
As RHEL-4.9 is the last update for RHEL-4, which should address only security, performance and critical issues, I'm closing this bug as WONTFIX. If you 
are still experiencing this issue with RHEL-5, please reopen it against RHEL-5.

If this issue is critical for you, please contact Red Hat support.