rpms/ntp/devel ntp-4.2.4p4-kernel.patch, NONE, 1.1 ntpdate.init, NONE, 1.1 ntpdate.sysconfig, NONE, 1.1 ntp-4.2.4-htmldoc.patch, 1.4, 1.5 ntp.spec, 1.76, 1.77 ntpd.init, 1.26, 1.27 ntpd.sysconfig, 1.7, 1.8
Miroslav Lichvar (mlichvar)
fedora-extras-commits at redhat.com
Fri Feb 29 14:54:38 UTC 2008
Author: mlichvar
Update of /cvs/pkgs/rpms/ntp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8870
Modified Files:
ntp-4.2.4-htmldoc.patch ntp.spec ntpd.init ntpd.sysconfig
Added Files:
ntp-4.2.4p4-kernel.patch ntpdate.init ntpdate.sysconfig
Log Message:
- reset kernel frequency when -x option is used
- create separate init script for ntpdate
- add note about paths and exit codes to ntpd man page
ntp-4.2.4p4-kernel.patch:
--- NEW FILE ntp-4.2.4p4-kernel.patch ---
diff -up ntp-4.2.4p4/ntpd/cmd_args.c.kernel ntp-4.2.4p4/ntpd/cmd_args.c
--- ntp-4.2.4p4/ntpd/cmd_args.c.kernel 2007-08-18 22:24:43.000000000 +0200
+++ ntp-4.2.4p4/ntpd/cmd_args.c 2008-02-27 16:57:56.000000000 +0100
@@ -179,8 +179,10 @@ getCmdOpts(
} while (--ct > 0);
}
- if (HAVE_OPT( SLEW ))
+ if (HAVE_OPT( SLEW )) {
clock_max = 600;
+ kern_enable = 0;
+ }
if (HAVE_OPT( UPDATEINTERVAL )) {
long val = OPT_VALUE_UPDATEINTERVAL;
diff -up ntp-4.2.4p4/ntpd/ntp_loopfilter.c.kernel ntp-4.2.4p4/ntpd/ntp_loopfilter.c
--- ntp-4.2.4p4/ntpd/ntp_loopfilter.c.kernel 2007-02-24 12:02:05.000000000 +0100
+++ ntp-4.2.4p4/ntpd/ntp_loopfilter.c 2008-02-27 16:57:56.000000000 +0100
@@ -337,8 +337,6 @@ local_clock(
*/
clock_frequency = flladj = plladj = 0;
mu = peer->epoch - sys_clocktime;
- if (clock_max == 0 || clock_max > 0.5)
- kern_enable = 0;
rval = 1;
if (fabs(fp_offset) > clock_max && clock_max > 0) {
switch (state) {
@@ -895,7 +893,7 @@ loop_config(
#ifdef STA_NANO
ntv.modes = MOD_BITS | MOD_NANO;
#else /* STA_NANO */
- ntv.modes = MOD_BITS;
+ ntv.modes = MOD_BITS | MOD_FREQUENCY;
#endif /* STA_NANO */
ntv.maxerror = MAXDISPERSE;
ntv.esterror = MAXDISPERSE;
@@ -1001,6 +999,8 @@ loop_config(
*/
case LOOP_MAX: /* step threshold */
clock_max = freq;
+ if (clock_max == 0 || clock_max > 0.5)
+ kern_enable = 0;
break;
case LOOP_PANIC: /* panic threshold */
--- NEW FILE ntpdate.init ---
#!/bin/bash
#
# chkconfig: - 57 75
# description: set the date and time via NTP
### BEGIN INIT INFO
# Provides: ntpdate
# Required-Start: $network $local_fs $remote_fs
# Should-Start: $syslog $named
# Short-Description: set the date and time via NTP
# Description: ntpdate sets the local clock by polling NTP servers
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
prog=ntpdate
lockfile=/var/lock/subsys/$prog
ntpconf=/etc/ntp.conf
ntpstep=/etc/ntp/step-tickers
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
}
start() {
[ "$NETWORKING" = "no" ] && exit 1
[ -x /usr/sbin/ntpdate ] || exit 5
[ -f /etc/sysconfig/ntpdate ] || exit 6
. /etc/sysconfig/ntpdate
[ -f $ntpstep ] && tickers=$(sed 's/#.*//' $ntpstep) || tickers=
if ! echo "$tickers" | grep -qi '[a-z0-9]' && [ -f $ntpconf ]; then
# step-tickers doesn't specify a server,
# use servers from ntp.conf instead
tickers=$(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \
egrep -v '127\.127\.[0-9]+\.[0-9]+')
fi
if ! echo "$tickers" | grep -qi '[a-z0-9]'; then
echo $"NTP server not specified in $ntpstep or $ntpconf"
exit 6
fi
echo -n $"$prog: Synchronizing with time server: "
/usr/sbin/ntpdate $OPTIONS $tickers &> /dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
success
touch $lockfile
[ "$SYNC_HWCLOCK" = "yes" ] && sync_hwclock
else
failure
fi
echo
return $RETVAL
}
status() {
[ -f $lockfile ] || return 3
}
stop() {
rm -f $lockfile
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|force-reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
exit 2
esac
--- NEW FILE ntpdate.sysconfig ---
# Options for ntpdate
OPTIONS="-U ntp -s -b"
# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no
ntp-4.2.4-htmldoc.patch:
Index: ntp-4.2.4-htmldoc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntp-4.2.4-htmldoc.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ntp-4.2.4-htmldoc.patch 26 Oct 2007 13:27:54 -0000 1.4
+++ ntp-4.2.4-htmldoc.patch 29 Feb 2008 14:54:31 -0000 1.5
@@ -9,8 +9,11 @@
<h4 id="descr">Description</h4>
<p>The <tt>ntpd</tt> program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. <tt>ntpd</tt> does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 picoseconds. While the ultimate precision is not achievable with ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs.</p>
<h4 id="op">How NTP Operates</h4>
-@@ -65,6 +65,10 @@
+@@ -63,8 +63,13 @@
+ <p>In contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
+ <p>Various internal <tt>ntpd</tt> variables can be displayed and configuration options altered while the <tt>ntpd</tt> is running using the <tt><a href="ntpq.html">ntpq</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> utility programs.</p>
<p>When <tt>ntpd</tt> starts it looks at the value of <tt>umask</tt>, and if zero <tt>ntpd</tt> will set the <tt>umask</tt> to <tt>022</tt>.</p>
++ <p>Unless the <tt>-n</tt>, <tt>-d</tt> or <tt>-D</tt> option is used, <tt>ntpd</tt> changes the current working directory to the root directory, so any options or commands specifying paths need to use an absolute path or a path relative to the root.</p>
<h4 id="cmd">Command Line Options</h4>
<dl>
+ <dt><tt>-4</tt>
@@ -20,7 +23,7 @@
<dt><tt>-a</tt>
<dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the default.
<dt><tt>-A</tt>
-@@ -78,13 +82,15 @@
+@@ -78,13 +83,15 @@
<dt><tt>-D <i>level</i></tt>
<dd>Specify debugging level directly.
<dt><tt>-f <i>driftfile</i></tt>
@@ -38,7 +41,7 @@
<dt><tt>-l <i>logfile</i></tt>
<dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> configuration command.
<dt><tt>-L</tt>
-@@ -143,7 +149,7 @@
+@@ -143,7 +150,7 @@
</tr>
<tr>
<td width="30%">frequency file</td>
@@ -47,7 +50,7 @@
<td width="20%"><tt>-f</tt></td>
<td width="20%"><tt>driftfile</tt></td>
</tr>
-@@ -167,14 +173,14 @@
+@@ -167,17 +174,20 @@
</tr>
<tr>
<td width="30%">statistics path</td>
@@ -65,6 +68,12 @@
<td width="20%"><tt>keysdir</tt></td>
</tr>
</table>
++ <h4 id="codes">Exit Codes</h4>
++ <p>A non-zero exit code indicates an error. Any error messages are logged to the system log by default.</p>
++ <p>The exit code is 0 only when <tt>ntpd</tt> is terminated by a signal, or when the <tt>-q</tt> option is used and <tt>ntpd</tt> successfully sets the system clock.</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
--- ntp-4.2.4/html/ntpdate.html.htmldoc 2007-01-05 15:40:59.000000000 +0100
+++ ntp-4.2.4/html/ntpdate.html 2007-01-05 15:40:59.000000000 +0100
@@ -18,9 +18,9 @@
@@ -176,7 +185,7 @@
<hr>
<h4 id="synop">Synopsis</h4>
- <p id="intro"><tt>ntp-keygen [ -deGgHIMnPT ] [ -c [RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ] [ -i <i>name</i> ] [ -p <i>password</i> ] [ -S [ RSA | DSA ] ] [ -s <i>name</i> ] [ -v <i>nkeys</i> ]</tt></p>
-+ <p id="intro"><tt>ntp-keygen [ -deGgHIMPT ] [ -c [RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ] [ -i <i>name</i> ] [ -p <i>password</i> ] [ -q <i>password</i> ] [ -S [ RSA | DSA ] ] [ -s <i>name</i> ] [ -v <i>nkeys</i> ] [ -V <i>params</i> ]</tt></p>
++ <p id="intro"><tt>ntp-keygen [ -deGgHIMPT ] [ -c [RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ] [ -i <i>name</i> ] [ -m <i>modulus</i> ] [ -p <i>password</i> ] [ -q <i>password</i> ] [ -S [ RSA | DSA ] ] [ -s <i>name</i> ] [ -v <i>nkeys</i> ] [ -V <i>params</i> ]</tt></p>
<h4 id="descrip">Description</h4>
<p>This program generates cryptographic data files used by the NTPv4 authentication and identification schemes. It generates MD5 key files used in symmetric key cryptography. In addition, if the OpenSSL software library has been installed, it generates keys, certificate and identity files used in public key cryptography. These files are used for cookie encryption, digital signature and challenge/response identification algorithms compatible with the Internet standard security infrastructure.</p>
<p>By default, files are not encrypted by <tt>ntp-keygen</tt>. The <tt>-p <i>password</i></tt> option specifies the write password and <tt>-q <i>password</i></tt> option the read password for previously encrypted files. The <tt>ntp-keygen</tt> program prompts for the password if it reads an encrypted file and the password is missing or incorrect. If an encrypted file is read successfully and no write password is specified, the read password is used as the write password by default.</p>
Index: ntp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntp.spec,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- ntp.spec 19 Feb 2008 14:09:01 -0000 1.76
+++ ntp.spec 29 Feb 2008 14:54:31 -0000 1.77
@@ -1,7 +1,7 @@
Summary: Synchronizes system time using the Network Time Protocol (NTP)
Name: ntp
Version: 4.2.4p4
-Release: 3%{?dist}
+Release: 4%{?dist}
# primary license (COPYRIGHT) : MIT
# ElectricFence/ (not used) : GPLv2
# kernel/sys/ppsclock.h (not used) : BSD with advertising
@@ -35,8 +35,11 @@
Source4: ntpd.sysconfig
Source5: ntpstat-0.2.tgz
Source6: ntp.step-tickers
+Source7: ntpdate.init
Source8: ntp.cryptopw
+Source9: ntpdate.sysconfig
+Patch1: ntp-4.2.4p4-kernel.patch
Patch2: ntp-4.2.4p0-droproot.patch
Patch3: ntp-4.2.4-groups.patch
Patch4: ntp-4.1.1c-rc3-authkey.patch
@@ -82,6 +85,7 @@
%prep
%setup -q -a 5
+%patch1 -p1 -b .kernel
%patch2 -p1 -b .droproot
%patch3 -p1 -b .groups
%patch4 -p1 -b .authkey
@@ -171,7 +175,9 @@
touch -r %{SOURCE1} .%{_sysconfdir}/ntp.conf
install -p -m600 %{SOURCE2} .%{_sysconfdir}/ntp/keys
install -p -m755 %{SOURCE3} .%{_initrddir}/ntpd
+install -p -m755 %{SOURCE7} .%{_initrddir}/ntpdate
install -p -m644 %{SOURCE4} .%{_sysconfdir}/sysconfig/ntpd
+install -p -m644 %{SOURCE9} .%{_sysconfdir}/sysconfig/ntpdate
install -p -m644 %{SOURCE6} .%{_sysconfdir}/ntp/step-tickers
install -p -m600 %{SOURCE8} .%{_sysconfdir}/ntp/crypto/pw
popd
@@ -185,12 +191,15 @@
%post
/sbin/chkconfig --add ntpd
+/sbin/chkconfig --add ntpdate
:
%preun
if [ "$1" -eq 0 ]; then
/sbin/service ntpd stop &> /dev/null
/sbin/chkconfig --del ntpd
+ /sbin/service ntpdate stop &> /dev/null
+ /sbin/chkconfig --del ntpdate
fi
:
@@ -213,7 +222,9 @@
%{_sbindir}/ntptime
%{_sbindir}/tickadj
%{_initrddir}/ntpd
+%{_initrddir}/ntpdate
%config(noreplace) %{_sysconfdir}/sysconfig/ntpd
+%config(noreplace) %{_sysconfdir}/sysconfig/ntpdate
%dir %{_sysconfdir}/ntp
%config(noreplace) %{_sysconfdir}/ntp.conf
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ntp/step-tickers
@@ -228,6 +239,11 @@
%changelog
+* Fri Feb 29 2008 Miroslav Lichvar <mlichvar at redhat.com> 4.2.4p4-4
+- reset kernel frequency when -x option is used
+- create separate init script for ntpdate
+- add note about paths and exit codes to ntpd man page
+
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 4.2.4p4-3
- Autorebuild for GCC 4.3
Index: ntpd.init
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntpd.init,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ntpd.init 24 Jul 2007 12:08:12 -0000 1.26
+++ ntpd.init 29 Feb 2008 14:54:31 -0000 1.27
@@ -13,7 +13,7 @@
# Provides: ntpd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
-# Should-Start: $syslog $named
+# Should-Start: $syslog $named ntpdate
# Should-Stop: $syslog $named
# Short-Description: start and stop ntpd
# Description: ntpd is the NTPv4 daemon. The Network Time Protocol (NTP)
@@ -28,74 +28,8 @@
# Source networking configuration.
. /etc/sysconfig/network
-if [ -f /etc/sysconfig/ntpd ];then
- . /etc/sysconfig/ntpd
-fi
-
prog=ntpd
lockfile=/var/lock/subsys/$prog
-ntpconf=/etc/ntp.conf
-ntpstep=/etc/ntp/step-tickers
-
-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
-}
-
-readconf() {
- dostep=''
- dropstr=''
- hasg=''
- OPTIND=1
- while getopts ":46aAbc:dD:f:gi:I:k:l:LmnN:p:P:qr:s:t:u:U:v:V:x" args $OPTIONS;
- do
- case "$args" in
- x) dostep=yes;;
- c) ntpconf="$OPTARG";;
- u) dropstr="-U $(echo $OPTARG | sed 's/:.*//')";;
- g) hasg=yes;;
- esac
- done
-
- tickers=''
- if [ -s "$ntpstep" ]; then
- tickers=$(sed 's/#.*//' $ntpstep)
- echo "$tickers" | grep -qi '[a-z0-9]' && dostep=yes || tickers=''
- fi
- if [ -n "$dostep" -a -z "$tickers" ]; then
- # -x option is used, but step-tickers doesn't exist or contain
- # anything useful, use servers from ntp.conf instead
- tickers=$(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \
- egrep -v '127\.127\.[0-9]+\.[0-9]+')
- fi
-}
start() {
# Check that networking is up.
@@ -103,24 +37,9 @@
[ -x /usr/sbin/ntpd ] || exit 5
- readconf;
+ [ -f /etc/sysconfig/ntpd ] || exit 6
+ . /etc/sysconfig/ntpd
- if [ -n "$dostep" ]; then
- echo -n $"$prog: Synchronizing with time server: "
- /usr/sbin/ntpdate $dropstr -s -b $NTPDATE_OPTIONS $tickers &>/dev/null
- RETVAL=$?
- [ $RETVAL -eq 0 ] && success || failure
- echo
- if [ $RETVAL -eq 0 ]; then
- [ "$SYNC_HWCLOCK" = "yes" ] && sync_hwclock
- elif [ -z "$hasg" ]; then
- OPTIONS="$OPTIONS -g"
- fi
- elif [ -z "$hasg" ]; then
- # -g can replace the grep for time servers
- # as it permits ntpd to violate its 1000s limit once.
- OPTIONS="$OPTIONS -g"
- fi
# Start daemons.
echo -n $"Starting $prog: "
daemon $prog $OPTIONS
@@ -155,7 +74,7 @@
start
;;
try-restart|condrestart)
- if status $prog > /dev/null; then
+ if [ -f $lockfile ]; then
stop
start
fi
Index: ntpd.sysconfig
===================================================================
RCS file: /cvs/pkgs/rpms/ntp/devel/ntpd.sysconfig,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ntpd.sysconfig 22 Nov 2006 14:44:56 -0000 1.7
+++ ntpd.sysconfig 29 Feb 2008 14:54:31 -0000 1.8
@@ -1,8 +1,2 @@
# Drop root to id 'ntp:ntp' by default.
-OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"
-
-# Set to 'yes' to sync hw clock after successful ntpdate
-SYNC_HWCLOCK=no
-
-# Additional options for ntpdate
-NTPDATE_OPTIONS=""
+OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
More information about the fedora-extras-commits
mailing list