[arch-commits] Commit in ntp/trunk (PKGBUILD changelog ntpd ntpdate)
Andrea Scarpino
andrea at archlinux.org
Sun Apr 3 17:50:27 UTC 2011
Date: Sunday, April 3, 2011 @ 13:50:26
Author: andrea
Revision: 117473
Use ntpd -p to create a pidfile (fixes FS#23473); fix minor errors in ntpdate (FS#22981); don't run the ntp client in background (FS#23572)
Modified:
ntp/trunk/PKGBUILD
ntp/trunk/changelog
ntp/trunk/ntpd
ntp/trunk/ntpdate
-----------+
PKGBUILD | 4 ++--
changelog | 6 ++++++
ntpd | 16 +++++++---------
ntpdate | 7 ++++---
4 files changed, 19 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2011-04-03 17:27:41 UTC (rev 117472)
+++ PKGBUILD 2011-04-03 17:50:26 UTC (rev 117473)
@@ -4,7 +4,7 @@
pkgname=ntp
pkgver=4.2.6.p3
_realver=4.2.6p3
-pkgrel=2
+pkgrel=3
pkgdesc="NTP (Network Time Protocol) tries to keep servers in sync"
arch=(i686 x86_64)
license=('custom')
@@ -22,7 +22,7 @@
ntpdate)
md5sums=('59876a9009b098ff59767ee45a88ebd2' '1b04e888717bb31479a6087632981723'
'398a7f270f6ae083f47f86eb8b557a75' '58997d6cf4846d80e35a01b855376a33'
- '2d8703c47ebd7a7196fe581d10f391e8' '9f3a53447b2222f1af161fbd498ecdf6')
+ 'bf20804e75656609e808ca21b53ea4aa' '99b49d763e5866f4f81c48d922c80b93')
build() {
cd "$srcdir/$pkgname-$_realver"
Modified: changelog
===================================================================
--- changelog 2011-04-03 17:27:41 UTC (rev 117472)
+++ changelog 2011-04-03 17:50:26 UTC (rev 117473)
@@ -1,3 +1,9 @@
+2011-04-03 andrea <andrea at archlinux.org>
+
+ * ntp 4.2.6p3-3
+ - Use 'ntpd -p' to get the PID in ntpd
+ - Don't run the ntp client in background in ntpdate
+
2011-03-28 andrea <andrea at archlinux.org>
* ntp 4.2.6p3-2
Modified: ntpd
===================================================================
--- ntpd 2011-04-03 17:27:41 UTC (rev 117472)
+++ ntpd 2011-04-03 17:50:26 UTC (rev 117473)
@@ -4,21 +4,19 @@
. /etc/rc.d/functions
. /etc/conf.d/ntp-client.conf
-getPID() {
- echo $(pidof -o %PPID /usr/bin/ntpd);
-}
+PIDFILE="/var/run/ntpd/ntpd.pid"
+PID=$(cat $PIDFILE 2> /dev/null)
case "$1" in
start)
stat_busy "Starting NTP Daemon"
[ ! -d /var/run/ntpd ] && install -d /var/run/ntpd &>/dev/null
- if [ -z "$(getPID)" ]; then
- /usr/bin/ntpd $NTPD_ARGS &>/dev/null &
+ if [ -z "$PID" ]; then
+ /usr/bin/ntpd $NTPD_ARGS -p /var/run/ntpd/ntpd.pid &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
- echo $(getPID) > /var/run/ntpd/ntpd.pid
add_daemon ntpd
stat_done
fi
@@ -29,13 +27,13 @@
;;
stop)
stat_busy "Stopping NTP Daemon"
- if [ ! -z "$(getPID)" ]; then
- kill $(getPID) &> /dev/null
+ if [ -n "$PID" ]; then
+ kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
- rm -f /var/run/ntpd/ntpd.pid &>/dev/null
+ rm $PIDFILE &>/dev/null
rm_daemon ntpd
stat_done
fi
Modified: ntpdate
===================================================================
--- ntpdate 2011-04-03 17:27:41 UTC (rev 117472)
+++ ntpdate 2011-04-03 17:50:26 UTC (rev 117473)
@@ -7,17 +7,18 @@
case "$1" in
start)
stat_busy "Starting NTP Client"
- /usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null &
+ /usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
+ exit 1
else
- add_daemon ntp-client
+ add_daemon ntpdate
stat_done
fi
;;
stop)
stat_busy "Stopping NTP Client"
- rm_daemon ntp-client
+ rm_daemon ntpdate
stat_done
;;
restart)
More information about the arch-commits
mailing list