summaryrefslogtreecommitdiff
path: root/extra/ntp
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-01-01 23:14:56 +0000
committerroot <root@rshg054.dnsready.net>2012-01-01 23:14:56 +0000
commit29f5aa692a3fa3ff3e743a47d1c57f1cc0341809 (patch)
tree862d365a74545cb3e7616d14e3b660aae977e6f8 /extra/ntp
parent8654516201466a2dd3f3f05a6c0095e69c01715c (diff)
Sun Jan 1 23:14:56 UTC 2012
Diffstat (limited to 'extra/ntp')
-rw-r--r--extra/ntp/PKGBUILD11
-rw-r--r--extra/ntp/install9
-rwxr-xr-xextra/ntp/ntpd81
-rwxr-xr-xextra/ntp/ntpdate44
4 files changed, 74 insertions, 71 deletions
diff --git a/extra/ntp/PKGBUILD b/extra/ntp/PKGBUILD
index f72d52b7a..8da3f4178 100644
--- a/extra/ntp/PKGBUILD
+++ b/extra/ntp/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 145633 2011-12-25 10:45:15Z bisson $
+# $Id: PKGBUILD 145791 2012-01-01 01:38:19Z bisson $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: kevin <kevin@archlinux.org>
pkgname=ntp
pkgver=4.2.6.p5
_realver=4.2.6p5
-pkgrel=1
+pkgrel=2
pkgdesc='Network Time Protocol reference implementation'
url='http://www.ntp.org/'
license=('custom')
@@ -19,8 +19,8 @@ source=("http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz"
'ntp.conf'
'ntpd.conf')
sha1sums=('4a5353a4791b6f4315a66c28d504ec6c7926b192'
- '97b41b8bc34f259f4e525ab2e58707c9724e72e2'
- '63572457586379aa6bf75b6e899e71d651e643f4'
+ '4e324e625c1f080b5c028be5092aa71adbf9bd99'
+ '01394b8a952f5edc85d19df8335eeac3980320f4'
'f6fa4838a33a3abcdd168a37b3f4a2dddd60472e'
'6cfcb7bbd34499b30e31dffca2f3e1a036010271')
@@ -29,7 +29,8 @@ install=install
build() {
cd "${srcdir}/${pkgname}-${_realver}"
- ./configure --prefix=/usr \
+ ./configure \
+ --prefix=/usr \
--mandir=/usr/share/man \
--enable-linux-caps \
diff --git a/extra/ntp/install b/extra/ntp/install
index ad9a39d54..926b4126e 100644
--- a/extra/ntp/install
+++ b/extra/ntp/install
@@ -7,4 +7,13 @@ post_upgrade() {
EOF
fi
+ if [[ $(vercmp $2 4.2.6.p5-1) -le 0 ]]; then
+ cat <<EOF
+
+==> The PID file /var/run/ntpd.pid has been renamed /run/ntpd.pid
+==> and the new rc.d script only takes the latter into account.
+==> To stop your old ntpd process, please kill it manually.
+
+EOF
+ fi
}
diff --git a/extra/ntp/ntpd b/extra/ntp/ntpd
index a3e886e1f..480fa1088 100755
--- a/extra/ntp/ntpd
+++ b/extra/ntp/ntpd
@@ -4,49 +4,44 @@
. /etc/rc.d/functions
. /etc/conf.d/ntpd.conf
-PIDFILE="/var/run/ntpd/ntpd.pid"
-PID=$(cat $PIDFILE 2> /dev/null)
+unset PID
+PIDFILE='/run/ntpd.pid'
+
+if [[ -r ${PIDFILE} ]]; then
+ read -r PID <"${PIDFILE}"
+ if [[ -n ${PID} && ! -d /proc/${PID} ]]; then
+ rm -f "${PIDFILE}"
+ unset PID
+ fi
+fi
case "$1" in
- start)
- stat_busy "Starting NTP Daemon"
- [ ! -d /var/run/ntpd ] && install -d /var/run/ntpd &>/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
- add_daemon ntpd
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
- stop)
- stat_busy "Stopping NTP Daemon"
- if [ -n "$PID" ]; then
- kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm $PIDFILE &>/dev/null
- rm_daemon ntpd
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
+ start)
+ stat_busy "Starting NTP Daemon"
+ if [[ -z ${PID} ]] && /usr/bin/ntpd ${NTPD_ARGS} -p "${PIDFILE}" &>/dev/null; then
+ add_daemon ntpd
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping NTP Daemon"
+ if [[ -n ${PID} ]] && kill "${PID}" &>/dev/null; then
+ rm ${PIDFILE}
+ rm_daemon ntpd
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
esac
diff --git a/extra/ntp/ntpdate b/extra/ntp/ntpdate
index 4f7c8375b..a8e746785 100755
--- a/extra/ntp/ntpdate
+++ b/extra/ntp/ntpdate
@@ -5,27 +5,25 @@
. /etc/conf.d/ntpd.conf
case "$1" in
- start)
- stat_busy "Starting NTP Client"
- /usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- add_daemon ntpdate
- stat_done
- fi
- ;;
- stop)
- stat_busy "Stopping NTP Client"
- rm_daemon ntpdate
- stat_done
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
+ start)
+ stat_busy "Starting NTP Client"
+ if /usr/bin/ntpd -q ${NTP_CLIENT_OPTION} &>/dev/null; then
+ add_daemon ntpdate
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping NTP Client"
+ rm_daemon ntpdate
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
esac
-