Bug 228424 - ntpd may fail to start if options include both -g and -x
ntpd may fail to start if options include both -g and -x
Product: Fedora
Classification: Fedora
Component: ntp (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Lichvar
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2007-02-12 20:09 EST by Stephen Casner
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-16 07:11:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch (803 bytes, patch)
2007-02-12 20:09 EST, Stephen Casner
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Network Time Protocol 777 None None None Never

  None (edit)
Description Stephen Casner 2007-02-12 20:09:00 EST
Description of problem:

When -x is included, the /etc/rc.d/init.d/ntpd script will run ntpdate to set
the time before starting ntpd.  In ntpdate fails, then the script will
add a -g option.  If the user-supplied options already include -g, then there
will be two, and consequently ntpd refuses to start (that is new behavior
sometime between 4.2.0 and 4.2.4).

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

ntpd 4.2.4 installed on an FC5 system from ntp-4.2.4-3.i386.rpm built
by me from ntp-4.2.4-3.fc6.src.rpm obtained from Fedora project (hence
I said FC6 as the version for this bug).

How reproducible: easy

Steps to Reproduce:
1. Configure /etc/ntp/step-tickers or server address in
   /etc/ntp.conf to be an unreachable address, and set
   /etc/sysconfig/ntp to:

OPTIONS="-g -x"

2. /etc/rc.d/init.d/ntpd start
Actual results:

> /etc/rc.d/init.d/ntpd start
ntpd: Synchronizing with time server:                      [FAILED]
Starting ntpd: ERROR:  only one panicgate option allowed
ntpd - NTP daemon program - Ver. 4.2.4
USAGE:  ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
[snipped usage text]
Options are specified by doubled hyphens and their name
or by a single hyphen and the flag character.

please send bug reports to:  http://bugs.ntp.isc.org, bugs@ntp.org

Expected results:

Even though ntpdate will fail, ntpd should start and run, rather than
quitting.  It will complain about the unreachable server, but if the
server later becomes reachable, ntpd will being peering with it.

Additional info:

The fix I recommend is for the /etc/rc.d/init.d/ntpd script to check if there
already is a -g option present before adding one.  Note that there are two
places in the start cause of that script where a -g is added.
Comment 1 Stephen Casner 2007-02-12 20:09:00 EST
Created attachment 147951 [details]
Proposed patch
Comment 2 Miroslav Lichvar 2007-02-14 09:23:27 EST
Thanks, will be in next release.
Comment 3 Miroslav Lichvar 2007-03-07 13:57:40 EST
Fixed in ntp-4.2.4p0-1.fc6.

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