From: <abe...@us...> - 2016-11-28 14:09:49
|
Revision: 7994 http://sourceforge.net/p/astlinux/code/7994 Author: abelbeck Date: 2016-11-28 14:09:47 +0000 (Mon, 28 Nov 2016) Log Message: ----------- ntp, ntpd: move the PIDFILE out of the config file since we depend on it being /var/run/ntpd.pid Modified Paths: -------------- branches/1.0/package/ntp/ntpd.init Modified: branches/1.0/package/ntp/ntpd.init =================================================================== --- branches/1.0/package/ntp/ntpd.init 2016-11-27 00:58:52 UTC (rev 7993) +++ branches/1.0/package/ntp/ntpd.init 2016-11-28 14:09:47 UTC (rev 7994) @@ -2,6 +2,8 @@ . /etc/rc.conf +PIDFILE="/var/run/ntpd.pid" + init () { # So sntp doesn't complain @@ -20,7 +22,6 @@ fi echo "# Autogenerated. Do not edit. -pidfile /var/run/ntpd.pid driftfile /var/lib/ntp/ntpd.drift restrict default noquery nopeer notrap nomodify @@ -74,12 +75,12 @@ fi sleep 1 # Maintain the clock (small changes) - ntpd $NTPAF -u ntp:ntp -g -c /etc/ntpd.conf + ntpd $NTPAF -p $PIDFILE -u ntp:ntp -g -c /etc/ntpd.conf elif ( set -o noclobber; echo "$$" > /var/lock/ntpd-delayed.lock ) 2>/dev/null; then echo "ntpd: server unreachable, will automatically retry in 2 minutes" ( sleep 120 - while [ ! -f /var/run/ntpd.pid ]; do + while [ ! -f $PIDFILE ]; do service ntpd start sleep 300 done @@ -92,10 +93,10 @@ stop () { - if [ -f /var/run/ntpd.pid ]; then + if [ -f $PIDFILE ]; then echo "Stopping ntpd..." - kill $(cat /var/run/ntpd.pid) >/dev/null 2>&1 - rm -f /var/run/ntpd.pid + kill $(cat $PIDFILE) >/dev/null 2>&1 + rm -f $PIDFILE fi } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |