core/dcron/crond

36 lines
600 B
Plaintext
Raw Normal View History

2006-02-23 16:26:10 +01:00
#!/bin/sh
#
# /etc/rc.d/crond: start/stop cron daemon
#
2015-06-26 17:12:32 +02:00
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/crond
OPTS="-S -l info"
2006-02-23 16:26:10 +01:00
case $1 in
start)
2015-06-26 17:12:32 +02:00
$SSD --start --exec $PROG -- $OPTS
2006-02-23 16:26:10 +01:00
;;
stop)
2015-06-26 17:12:32 +02:00
$SSD --stop --retry 10 --exec $PROG
2006-02-23 16:26:10 +01:00
;;
restart)
$0 stop
$0 start
;;
2015-06-26 17:12:32 +02:00
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running with pid $(pidof $PROG)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
2006-02-23 16:26:10 +01:00
*)
2015-06-26 17:12:32 +02:00
echo "usage: $0 [start|stop|restart|status]"
2006-02-23 16:26:10 +01:00
;;
esac
# End of file