Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 290381 Details for
Bug 426749
An "-x" option in "/etc/sysconfig/ntpd" would be used contrariwise to what is indicated in the ntpd manpage
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Modified /etc/rc.d/init.d/ntpd script
ntpd.modified (text/plain), 5.30 KB, created by
David Tonhofer
on 2007-12-25 20:08:59 UTC
(
hide
)
Description:
Modified /etc/rc.d/init.d/ntpd script
Filename:
MIME Type:
Creator:
David Tonhofer
Created:
2007-12-25 20:08:59 UTC
Size:
5.30 KB
patch
obsolete
>#!/bin/bash ># ># ntpd This shell script takes care of starting and stopping ># ntpd (NTPv4 daemon). ># ># chkconfig: 2345 58 74 ># description: ntpd is the NTPv4 daemon. \ ># The Network Time Protocol (NTP) is used to synchronize the time of \ ># a computer client or server to another server or reference time source, \ ># such as a radio or satellite receiver or modem. > ># Source function library. >. /etc/init.d/functions > ># Source networking configuration. >. /etc/sysconfig/network > ># Check that networking is up. >[ ${NETWORKING} = "no" ] && exit 0 > ># Source any additional options >if [ -f /etc/sysconfig/ntpd ];then > . /etc/sysconfig/ntpd >fi > ># Default configuration file (may be overridden through /etc/sysconfig/ntpd) >ntpconf=/etc/ntp.conf > ># List of NTP servers which are used to "step" the clock once to a correct value ># at startup using "ntpdate" (this usage is deprecated, see the ntpd manpage) >ntpstep=/etc/ntp/step-tickers > > >RETVAL=0 >prog="ntpd" > ># Synchronize hardware clock to the system time after a successful "ntpdate" ># execution at startup (this operation is done by ntpd while it runs normally) >sync_hwclock() { > ARC=0 > SRM=0 > UTC=0 > > if [ -f /etc/sysconfig/clock ]; then > . /etc/sysconfig/clock > > # convert old style clock config to new values > if [ "${CLOCKMODE}" = "GMT" ]; then > UTC=true > elif [ "${CLOCKMODE}" = "ARC" ]; then > ARC=true > fi > fi > > CLOCKFLAGS="$CLOCKFLAGS --systohc" > > case "$UTC" in > yes|true) CLOCKFLAGS="$CLOCKFLAGS --utc";; > no|false) CLOCKFLAGS="$CLOCKFLAGS --localtime";; > esac > case "$ARC" in > yes|true) CLOCKFLAGS="$CLOCKFLAGS --arc";; > esac > case "$SRM" in > yes|true) CLOCKFLAGS="$CLOCKFLAGS --srm";; > esac > > action $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS >} > ># Additional configuration check at startup; interpretes the arguments set by the ># sourcing of "/etc/sysconfig/ntpd": OPTIONS, USE_NTPDATE, SYNC_HWCLOCK >readconf() { > dostep='' > dropstr='' > tickers='' > OPTIND=1 > if [ "$USE_NTPDATE" = "yes" ]; then > # Use "ntpdate" to step the clocks to a correct value using the > # NTP servers listed in the "step-tickers" file once before "ntpd" is > # started. This may be useful for clocks that go wrong quickly. > dostep=yes > fi > # Check OPTIONS to be passed to ntpd. > # By default OPTIONS is equal to "-u ntp -p /var/run/ntpd.pid". > # We will now check for the presence of "-c" and "-u": > # "-c" is used to set another configuration file > # "-u" is used to change user (-U is deprecated; any "group" is irrelevant > # and filtered out) > while getopts ":aAbc:dD:f:gi:k:l:LmnN:p:P:qr:s:t:u:U:v:V:x" args $OPTIONS; > do > case "$args" in > x) if [ -z "$USE_NTPDATE" ]; then > echo "The '-x' in /etc/sysconfig/ntpd no longer starts ntpdate; use USE_NTPDATE=yes instead" > fi > ;; > c) ntpconf="$OPTARG";; # override the default ntpconf by the one given > u|U) dropstr="-U $(echo $OPTARG | sed 's/:.*//')" # dropstr will be used for "ntpdate" > if [ "$args" = "U" ]; then > # correct the OPTIONS string for "ntpd" > OPTIONS=$(echo $OPTIONS | sed 's/-U/-u/g') > echo "Please change '-U' to '-u' in /etc/sysconfig/ntpd" > fi > ;; > esac > done > > # Check that the "ntpd" executable and the config file actually exist > [ -x /usr/sbin/ntpd -a -f $ntpconf ] || exit 0 > > # Collect the "step tickers" i.e. the NTP servers for "ntpdate", but only > # if necessary > if [ -n "$dostep" ]; then > if [ -s "$ntpstep" ]; then > # file "$ntpstep" exists and contains text; eliminate comments and set > tickers=$(sed 's/#.*//' $ntpstep) > # unset "tickers" again if actually no valid lines found > echo "$tickers" | grep -qi '[a-z0-9]' && dostep=yes || tickers='' > fi > if [ -z "$tickers" ]; then > # tickers still not set, use servers from ntp.conf instead > tickers=$(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \ > fgrep -v 127.127.1.0) > fi > fi >} > >start() { > readconf; > > if [ -n "$dostep" ]; then > echo -n $"$prog: Synchronizing with time server: " > /usr/sbin/ntpdate $dropstr -s -b $tickers 2>/dev/null >/dev/null > RETVAL=$? > [ $RETVAL -eq 0 ] && success || failure > echo > if [ $RETVAL -eq 0 ]; then > [ "$SYNC_HWCLOCK" = "yes" ] && sync_hwclock > else > OPTIONS="$OPTIONS -g" > fi > fi > # -g can replace the grep for time servers > # as it permits ntpd to violate its 1000s limit once. > # if "-g" is desired, set it in OPTIONS. > # Start daemons. > echo -n $"Starting $prog: " > daemon ntpd $OPTIONS > RETVAL=$? > echo > [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd > return $RETVAL >} > >stop() { > echo -n $"Shutting down $prog: " > killproc ntpd > RETVAL=$? > echo > [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ntpd > return $RETVAL >} > ># See how we were called. >case "$1" in > start) > start > ;; > stop) > stop > ;; > status) > status ntpd > RETVAL=$? > ;; > restart|reload) > stop > start > RETVAL=$? > ;; > condrestart) > if [ -f /var/lock/subsys/ntpd ]; then > stop > start > RETVAL=$? > fi > ;; > *) > echo $"Usage: $0 {start|stop|restart|condrestart|status}" > exit 1 >esac > >exit $RETVAL >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 426749
:
290380
| 290381 |
290382