Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 228424 - ntpd may fail to start if options include both -g and -x
Summary: ntpd may fail to start if options include both -g and -x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ntp
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-13 01:09 UTC by Stephen Casner
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-16 11:11:08 UTC


Attachments (Terms of Use)
Proposed patch (deleted)
2007-02-13 01:09 UTC, Stephen Casner
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Network Time Protocol 777 None None None Never

Description Stephen Casner 2007-02-13 01:09:00 UTC
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
                                                           [FAILED]

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-13 01:09:00 UTC
Created attachment 147951 [details]
Proposed patch

Comment 2 Miroslav Lichvar 2007-02-14 14:23:27 UTC
Thanks, will be in next release.

Comment 3 Miroslav Lichvar 2007-03-07 18:57:40 UTC
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.