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

Andrea Scarpino andrea at archlinux.org
Mon Mar 28 15:59:02 UTC 2011


    Date: Monday, March 28, 2011 @ 11:59:01
  Author: andrea
Revision: 117086

upgpkg: ntp 4.2.6.p3-2
Impreved daemon scripts, also fixes FS#23473

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

-----------+
 PKGBUILD  |   17 ++++++++++-------
 changelog |    5 +++++
 ntpd      |   44 +++++++++++++++++++++++++++++---------------
 ntpdate   |    5 ++---
 4 files changed, 46 insertions(+), 25 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-03-28 15:27:37 UTC (rev 117085)
+++ PKGBUILD	2011-03-28 15:59:01 UTC (rev 117086)
@@ -4,7 +4,7 @@
 pkgname=ntp
 pkgver=4.2.6.p3
 _realver=4.2.6p3
-pkgrel=1
+pkgrel=2
 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'
-         '46118a8ec2c4f5bbfafd730af21b7c03' '486c0d16bb67cf26b4e64abddc50a573')
+         '2d8703c47ebd7a7196fe581d10f391e8' '9f3a53447b2222f1af161fbd498ecdf6')
 
 build() {
   cd "$srcdir/$pkgname-$_realver"
@@ -33,7 +33,9 @@
   # 4.2.6p3: aclocal too old, regenerate
   rm -f aclocal.m4
   libtoolize --copy --force
-  ac_cv_header_dns_sd_h=0 ./configure --prefix=/usr --mandir=/usr/share/man --enable-linux-caps
+  ac_cv_header_dns_sd_h=0 ./configure --prefix=/usr \
+    --mandir=/usr/share/man \
+    --enable-linux-caps
   # build
   make
 }
@@ -45,11 +47,11 @@
   make DESTDIR="$pkgdir" install
 
   # install conf files
-  mkdir -p "$pkgdir/usr/share/ntp"
+  install -d "$pkgdir/usr/share/ntp"
   install -D -m644 conf/* "${pkgdir}/usr/share/ntp"
 
   # install launch scripts 
-  mkdir -p "$pkgdir/etc/rc.d"
+  install -d "$pkgdir/etc/rc.d"
   install -D -m755 ${srcdir}/{ntpd,ntpdate} "$pkgdir/etc/rc.d"
 
   # install man pages
@@ -68,8 +70,9 @@
   	"$pkgdir/etc/conf.d/ntp-client.conf"
 
   # create /var/lib/ntp
-  mkdir -p "$pkgdir/var/lib/ntp"
+  install -d "$pkgdir/var/lib/ntp"
   touch "$pkgdir/var/lib/ntp/.placeholder"
 
-  install -Dm644 "$srcdir/$pkgname-$_realver/COPYRIGHT" "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
+  install -Dm644 "$srcdir/$pkgname-$_realver/COPYRIGHT" \
+    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }

Modified: changelog
===================================================================
--- changelog	2011-03-28 15:27:37 UTC (rev 117085)
+++ changelog	2011-03-28 15:59:01 UTC (rev 117086)
@@ -1,3 +1,8 @@
+2011-03-28  andrea <andrea at archlinux.org>
+
+    * ntp 4.2.6p3-2
+    - Improved daemon scripts
+
 2010-10-16  kevin  <kevin at archlinux.org>
 
     * ntp 4.2.6p3

Modified: ntpd
===================================================================
--- ntpd	2011-03-28 15:27:37 UTC (rev 117085)
+++ ntpd	2011-03-28 15:59:01 UTC (rev 117086)
@@ -4,30 +4,44 @@
 . /etc/rc.d/functions
 . /etc/conf.d/ntp-client.conf
 
-PID=`pidof -o %PPID /usr/bin/ntpd`
+getPID() {
+   echo $(pidof -o %PPID /usr/bin/ntpd);
+}
+
 case "$1" in
   start)
     stat_busy "Starting NTP Daemon"
-    if [ -z "$PID" ]; then 
-       /usr/bin/ntpd $NTPD_ARGS &
-    fi
-    if [ ! -z "$PID" -o $? -gt 0 ]; then
+    [ ! -d /var/run/ntpd ] && install -d /var/run/ntpd &>/dev/null
+    if [ -z "$(getPID)" ]; then 
+       /usr/bin/ntpd $NTPD_ARGS &>/dev/null &
+      if [ $? -gt 0 ]; then
+        stat_fail
+        exit 1
+      else
+        echo $(getPID) > /var/run/ntpd/ntpd.pid
+        add_daemon ntpd
+        stat_done
+      fi
+    else
       stat_fail
-    else
-      PID=`pidof -o %PPID /usr/bin/ntpd`
-      echo $PID > /var/run/ntpd.pid
-      add_daemon ntpd
-      stat_done
+      exit 1
     fi
     ;;
   stop)
     stat_busy "Stopping NTP Daemon"
-    [ ! -z "$PID" ]  && kill $PID &> /dev/null
-    if [ $? -gt 0 ]; then
+    if [ ! -z "$(getPID)" ]; then
+      kill $(getPID) &> /dev/null
+      if [ $? -gt 0 ]; then
+        stat_fail
+        exit 1
+      else
+        rm -f /var/run/ntpd/ntpd.pid &>/dev/null
+        rm_daemon ntpd
+        stat_done
+      fi
+    else
       stat_fail
-    else
-      rm_daemon ntpd
-      stat_done
+      exit 1
     fi
     ;;
   restart)

Modified: ntpdate
===================================================================
--- ntpdate	2011-03-28 15:27:37 UTC (rev 117085)
+++ ntpdate	2011-03-28 15:59:01 UTC (rev 117086)
@@ -7,8 +7,8 @@
 case "$1" in
   start)
     stat_busy "Starting NTP Client"
-    /usr/bin/ntpd -q $NTP_CLIENT_OPTION > /dev/null 2>&1
-    if [  $? -gt 0 ]; then
+    /usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null &
+    if [ $? -gt 0 ]; then
       stat_fail
     else
       add_daemon ntp-client
@@ -22,7 +22,6 @@
     ;;
   restart)
     $0 stop
-    sleep 1
     $0 start
     ;;
   *)




More information about the arch-commits mailing list