[arch-commits] Commit in ntp/trunk (PKGBUILD install ntpd ntpdate)

Gaetan Bisson bisson at archlinux.org
Tue Dec 27 02:23:28 UTC 2011


    Date: Monday, December 26, 2011 @ 21:23:27
  Author: bisson
Revision: 145677

implement FS#27728

Modified:
  ntp/trunk/PKGBUILD
  ntp/trunk/install
  ntp/trunk/ntpd
  ntp/trunk/ntpdate

----------+
 PKGBUILD |    9 +++---
 install  |    9 ++++++
 ntpd     |   81 ++++++++++++++++++++++++++++---------------------------------
 ntpdate  |   44 +++++++++++++++------------------
 4 files changed, 73 insertions(+), 70 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-12-26 22:21:16 UTC (rev 145676)
+++ PKGBUILD	2011-12-27 02:23:27 UTC (rev 145677)
@@ -5,7 +5,7 @@
 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 @@
         'ntp.conf'
         'ntpd.conf')
 sha1sums=('4a5353a4791b6f4315a66c28d504ec6c7926b192'
-          '97b41b8bc34f259f4e525ab2e58707c9724e72e2'
-          '63572457586379aa6bf75b6e899e71d651e643f4'
+          '4e324e625c1f080b5c028be5092aa71adbf9bd99'
+          '01394b8a952f5edc85d19df8335eeac3980320f4'
           'f6fa4838a33a3abcdd168a37b3f4a2dddd60472e'
           '6cfcb7bbd34499b30e31dffca2f3e1a036010271')
 
@@ -29,7 +29,8 @@
 build() {
 	cd "${srcdir}/${pkgname}-${_realver}"
 
-	./configure --prefix=/usr \
+	./configure \
+		--prefix=/usr \
 		--mandir=/usr/share/man \
 		--enable-linux-caps \
 

Modified: install
===================================================================
--- install	2011-12-26 22:21:16 UTC (rev 145676)
+++ install	2011-12-27 02:23:27 UTC (rev 145677)
@@ -7,4 +7,13 @@
 
 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
 }

Modified: ntpd
===================================================================
--- ntpd	2011-12-26 22:21:16 UTC (rev 145676)
+++ ntpd	2011-12-27 02:23:27 UTC (rev 145677)
@@ -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

Modified: ntpdate
===================================================================
--- ntpdate	2011-12-26 22:21:16 UTC (rev 145676)
+++ ntpdate	2011-12-27 02:23:27 UTC (rev 145677)
@@ -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
-




More information about the arch-commits mailing list