summaryrefslogtreecommitdiff
path: root/chrony/chronyd
blob: 9207b9ce567899cde59117a30fd155127cafd9cf (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/chronyd: start/stop the chrony time server
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/sbin/chronyd
    8 OPTS="-r"
    9 
   10 case $1 in
   11 start)
   12 	$SSD --start --exec $PROG -- $OPTS
   13 	;;
   14 stop)
   15 	$SSD --stop --retry 10 --exec $PROG
   16 	;;
   17 restart)
   18 	$0 stop
   19 	$0 start
   20 	;;
   21 online)
   22 	/usr/bin/chronyc online
   23 	;;
   24 offline)
   25 	/usr/bin/chronyc << EOF > /dev/null
   26 	offline
   27 	dump
   28 	writertc
   29 EOF
   30 	;;
   31 status)
   32 	$SSD --status --exec $PROG
   33 	case $? in
   34 	0)   echo "$PROG is running with pid $(pidof $PROG)" ;;
   35 	1|3) echo "$PROG is not running" ;;
   36 	4)   echo "Unable to determine the program status" ;;
   37 	esac
   38 	;;
   39 *)
   40 	echo "usage: $0 [start|stop|restart|online|offline|status]"
   41 	;;
   42 esac
   43 
   44 # End of file

Generated by cgit