#!/bin/sh # # chrony This shell script takes care of starting and stopping # chronyd (daemon). # # chkconfig: 2345 55 10 # description: chronyd is a timeserver daemon. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x /usr/local/sbin/chronyd -a -f /etc/chrony.conf ] || exit 0 # See how we were called. case "$1" in start) # Start daemons. gprintf "Starting chronyd: " daemon /usr/local/sbin/chronyd -r -s echo touch /var/lock/subsys/chronyd ;; stop) # Stop daemons. gprintf "Shutting down chronyd: " killproc chronyd echo rm -f /var/lock/subsys/chronyd ;; status) status chronyd ;; restart) $0 stop $0 start ;; reload) $0 stop $0 start ;; condrestart) if [ -f /var/lock/subsys/chronyd ]; then $0 stop $0 start fi ;; *) gprintf "Usage: chrony {start|stop|restart|status}\n" exit 1 esac exit 0