ports/opt (3.1): [notify] chrony: update to 1.31.1, improved rc script

crux at crux.nu crux at crux.nu
Tue Apr 7 15:22:20 UTC 2015


commit 5b70f814a45225e162fe7e9dc14cca11ebbeeb1d
Author: Juergen Daubert <jue at jue.li>
Date:   Tue Apr 7 17:20:36 2015 +0200

    [notify] chrony: update to 1.31.1, improved rc script
    
    Security fixes, see http://chrony.tuxfamily.org/News.html

diff --git a/chrony/.md5sum b/chrony/.md5sum
index 2d2a844..61c0918 100644
--- a/chrony/.md5sum
+++ b/chrony/.md5sum
@@ -1,4 +1,4 @@
-04ab702fc81150db06809562a9aaed92  chrony-1.31.tar.gz
+01e54c63d09a310f30c4e399f18499df  chrony-1.31.1.tar.gz
 4dff89484fe7b6d6397a9501c7ae51ed  chrony.conf
 ec43dcf700698a7d2891a1f8504b5e22  chrony.keys
-ef4b4ca7c250397656d81a329faf60d2  chronyd
+2999f364c83286816d71379130d1eae6  chronyd
diff --git a/chrony/Pkgfile b/chrony/Pkgfile
index be0c175..48b5003 100644
--- a/chrony/Pkgfile
+++ b/chrony/Pkgfile
@@ -1,10 +1,10 @@
 # Description: Network time protocol client/server
 # URL:         http://chrony.tuxfamily.org/
 # Maintainer:  Juergen Daubert, jue at crux dot nu
-# Depends on:  ncurses readline libcap
+# Depends on:  readline libcap
 
 name=chrony
-version=1.31
+version=1.31.1
 release=1
 source=(http://download.tuxfamily.org/$name/$name-$version.tar.gz
         chronyd chrony.conf chrony.keys)
diff --git a/chrony/chronyd b/chrony/chronyd
index 53f1e9e..e4d8a53 100644
--- a/chrony/chronyd
+++ b/chrony/chronyd
@@ -3,19 +3,23 @@
 # /etc/rc.d/chronyd: start/stop the chrony time server
 #
 
-KEY=`sed -n "s/^commandkey *//p" /etc/chrony.conf`
-PASSWD=`sed -n "s/^$KEY *//p" /etc/chrony.keys`
+SSD=/sbin/start-stop-daemon
+PROG=/usr/sbin/chronyd
+PID=/var/run/chronyd.pid
+OPTS="-s -r"
+
+KEY=$(sed -n "s/^commandkey *//p" /etc/chrony.conf)
+PASSWD=$(sed -n "s/^$KEY *//p" /etc/chrony.keys)
 
 case $1 in
 start)
-	/usr/sbin/chronyd -s -r
+	$SSD --start --pidfile $PID --exec $PROG -- $OPTS
 	;;
 stop)
-	killall -q  /usr/sbin/chronyd
+	$SSD --stop --retry 10 --pidfile $PID
 	;;
 restart)
 	$0 stop
-	sleep 2
 	$0 start
 	;;
 online)
@@ -32,8 +36,17 @@ offline)
 	writertc
 EOF
 	;;
+status)
+	$SSD --status --pidfile $PID
+	case $? in
+	0) echo "$PROG is running with pid $(cat $PID)" ;;
+	1) echo "$PROG is not running but the pid file $PID exists" ;;
+	3) echo "$PROG is not running" ;;
+	4) echo "Unable to determine the program status" ;;
+	esac
+	;;
 *)
-	echo "usage: $0 [start|stop|restart|online|offline]"
+	echo "usage: $0 [start|stop|restart|online|offline|status]"
 	;;
 esac
 



More information about the CRUX mailing list