aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Mitchell <jmitchell@cbnl.com>2014-06-02 15:40:51 +0100
committerJoe MacDonald <joe@deserted.net>2014-06-03 21:57:28 -0400
commitf3518c4c748b64dde3b14c6d73cd6c15d1b92166 (patch)
tree59b89cf1bb17124dc1aaddb8dbe935a24fe79290
parent4ae3822224cd78c73c3af25a137e0672278d276f (diff)
downloadmeta-openembedded-contrib-f3518c4c748b64dde3b14c6d73cd6c15d1b92166.tar.gz
ntp: fix incorrect pidfile handling in ntpd init script
Signed-off-by: Jack Mitchell <jmitchell@cbnl.com> Signed-off-by: Joe MacDonald <joe@deserted.net>
-rwxr-xr-xmeta-networking/recipes-support/ntp/files/ntpd21
1 files changed, 17 insertions, 4 deletions
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd
index a62b8ce691..3cd1c6c585 100755
--- a/meta-networking/recipes-support/ntp/files/ntpd
+++ b/meta-networking/recipes-support/ntp/files/ntpd
@@ -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"
}