diff options
| -rwxr-xr-x | meta-networking/recipes-support/ntp/files/ntpd | 21 |
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 @@ | |||
| 1 | #! /bin/sh | 1 | #! /bin/sh |
| 2 | # | 2 | |
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: ntp | ||
| 5 | # Required-Start: $network $remote_fs $syslog | ||
| 6 | # Required-Stop: $network $remote_fs $syslog | ||
| 7 | # Default-Start: 2 3 4 5 | ||
| 8 | # Default-Stop: | ||
| 9 | # Short-Description: Start NTP daemon | ||
| 10 | ### END INIT INFO | ||
| 11 | |||
| 3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | 12 | PATH=/sbin:/bin:/usr/bin:/usr/sbin |
| 4 | 13 | ||
| 14 | DAEMON=/usr/sbin/ntpd | ||
| 15 | PIDFILE=/var/run/ntpd.pid | ||
| 16 | |||
| 5 | # ntpd init.d script for ntpdc from ntp.isc.org | 17 | # ntpd init.d script for ntpdc from ntp.isc.org |
| 6 | test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0 | 18 | test -x $DAEMON -a -r /etc/ntp.conf || exit 0 |
| 19 | |||
| 7 | # rcS contains TICKADJ | 20 | # rcS contains TICKADJ |
| 8 | test -r /etc/default/rcS && . /etc/default/rcS | 21 | test -r /etc/default/rcS && . /etc/default/rcS |
| 9 | 22 | ||
| @@ -23,12 +36,12 @@ startdaemon(){ | |||
| 23 | # this. If ntpd seems to disappear after a while assume TICKADJ | 36 | # this. If ntpd seems to disappear after a while assume TICKADJ |
| 24 | # above is set to a totally incorrect value. | 37 | # above is set to a totally incorrect value. |
| 25 | echo -n "Starting ntpd: " | 38 | echo -n "Starting ntpd: " |
| 26 | start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@" | 39 | start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@" |
| 27 | echo "done" | 40 | echo "done" |
| 28 | } | 41 | } |
| 29 | stopdaemon(){ | 42 | stopdaemon(){ |
| 30 | echo -n "Stopping ntpd: " | 43 | echo -n "Stopping ntpd: " |
| 31 | start-stop-daemon --stop -p /var/run/ntp.pid | 44 | start-stop-daemon --stop --quiet --oknodo -p $PIDFILE |
| 32 | echo "done" | 45 | echo "done" |
| 33 | } | 46 | } |
| 34 | 47 | ||
