diff options
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd')
-rw-r--r-- | meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd new file mode 100644 index 000000000..04f1b681c --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd @@ -0,0 +1,58 @@ +#! /bin/sh + +# System V init script for chrony +# Adapted from the script already in meta-networking for ntpd + +### BEGIN INIT INFO +# Provides: chrony +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Start chrony time daemon +### END INIT INFO + +PATH=/sbin:/bin:/usr/bin:/usr/sbin + +DAEMON=/usr/sbin/chronyd +PIDFILE=/var/run/chronyd.pid + +test -x $DAEMON -a -r /etc/chrony.conf || exit 0 + +# Source function library. +. /etc/init.d/functions + +# Functions to do individual actions +startdaemon(){ + echo -n "Starting chronyd: " + start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- "$@" + echo "done" +} +stopdaemon(){ + echo -n "Stopping chronyd: " + start-stop-daemon --stop --quiet --oknodo -p $PIDFILE + echo "done" +} + +case "$1" in + start) + startdaemon + ;; + stop) + stopdaemon + ;; + force-reload | restart | reload) + stopdaemon + startdaemon + ;; + status) + status /usr/sbin/chronyd; + exit $? + ;; + *) + echo "Usage: chronyd { start | stop | status | restart | reload }" >&2 + exit 1 + ;; +esac + +exit 0 |