Skip to contentSkip to conversation

ntp: fix incorrect pidfile handling in ntpd init script

PATCH Applied Jack Mitchell 2 participants 2 messages Jun 2, 2014 – Jun 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntp: fix incorrect pidfile handling in ntpd init script

From: Jack Mitchell <[email protected]>

---
 meta-networking/recipes-support/ntp/files/ntpd | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta-networking/recipes-support/ntp/files/ntpd +17 -4
index a62b8ce..3cd1c6c 100755
@@ -1,9 +1,22 @@
 #! /bin/sh
-#
+
+### BEGIN INIT INFO
+# Provides:        ntp
+# Required-Start:  $network $remote_fs $syslog
+# Required-Stop:   $network $remote_fs $syslog
+# Default-Start:   2 3 4 5
+# Default-Stop:
+# Short-Description: Start NTP daemon
+### END INIT INFO
+
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
 
+DAEMON=/usr/sbin/ntpd
+PIDFILE=/var/run/ntpd.pid
+
 # ntpd	init.d script for ntpdc from ntp.isc.org
-test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0
+test -x $DAEMON -a -r /etc/ntp.conf || exit 0
+
 # rcS contains TICKADJ
 test -r /etc/default/rcS && . /etc/default/rcS
 
@@ -23,12 +36,12 @@ startdaemon(){
 	# this.  If ntpd seems to disappear after a while assume TICKADJ
 	# above is set to a totally incorrect value.
 	echo -n "Starting ntpd: "
-	start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
+	start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@"
 	echo "done"
 }
 stopdaemon(){
 	echo -n "Stopping ntpd: "
-	start-stop-daemon --stop -p /var/run/ntp.pid
+	start-stop-daemon --stop --quiet --oknodo -p $PIDFILE
 	echo "done"
 }
 
Signature · 1 line
1.9.3
#1 lore raw

Merged, thanks.
-Joe.

Quoted 59 lines · Jack Mitchell

From: Jack Mitchell <[email protected]>

---
 meta-networking/recipes-support/ntp/files/ntpd | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta-networking/recipes-support/ntp/files/ntpd +17 -5
index a62b8ce..3cd1c6c 100755
@@ -1,9 +1,22 @@
 #! /bin/sh
-#
+
+### BEGIN INIT INFO
+# Provides:        ntp
+# Required-Start:  $network $remote_fs $syslog
+# Required-Stop:   $network $remote_fs $syslog
+# Default-Start:   2 3 4 5
+# Default-Stop:
+# Short-Description: Start NTP daemon
+### END INIT INFO
+
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
 
+DAEMON=/usr/sbin/ntpd
+PIDFILE=/var/run/ntpd.pid
+
 # ntpd init.d script for ntpdc from ntp.isc.org
-test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0
+test -x $DAEMON -a -r /etc/ntp.conf || exit 0
+
 # rcS contains TICKADJ
 test -r /etc/default/rcS && . /etc/default/rcS
 
@@ -23,12 +36,12 @@ startdaemon(){
        # this.  If ntpd seems to disappear after a while assume TICKADJ
        # above is set to a totally incorrect value.
        echo -n "Starting ntpd: "
-       start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
+       start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@"
        echo "done"
 }
 stopdaemon(){
        echo -n "Stopping ntpd: "
-       start-stop-daemon --stop -p /var/run/ntp.pid
+       start-stop-daemon --stop --quiet --oknodo -p $PIDFILE
        echo "done"
 }
 
--

1.9.3

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel