chrony/chronyd-initscript

68 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#! /bin/bash
#
# chronyd Start/Stop the chronyd NTP daemon.
#
# chkconfig: 345 55 10
# description: chronyd is a daemon which obtains measurements via the network \
# of the system clocks offset relative to time servers on other \
# systems and adjusts the system time accordingly.
# processname: chronyd
# pidfile: /var/run/chronyd.pid
# Source function library.
. /etc/init.d/functions
RETVAL=0
prog="chronyd"
start() {
echo -n $"Starting $prog: "
daemon chronyd < /dev/null
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/chronyd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc chronyd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/chronyd
return $RETVAL
}
rhstatus() {
statusproc chronyd
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/chronyd ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $?