opt/fcron/fcron

48 lines
847 B
Plaintext
Raw Normal View History

2006-02-23 16:26:10 +01:00
#!/bin/sh
#
# /etc/rc.d/fcron: start/stop fcron daemon
#
2015-03-05 11:09:54 +01:00
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/fcron
PID=/var/run/fcron.pid
OPTS="--background"
2006-02-23 16:26:10 +01:00
case $1 in
start)
2015-03-05 11:09:54 +01:00
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
2015-10-05 13:06:28 +02:00
RETVAL=$?
2015-10-05 13:18:42 +02:00
if [ $RETVAL -eq 0 -a ! -f /var/spool/fcron/systab ]; then
2015-10-05 13:06:28 +02:00
/usr/bin/fcrontab -u systab -z
2006-02-23 16:26:10 +01:00
fi
;;
stop)
2015-03-05 11:09:54 +01:00
$SSD --stop --retry 10 --pidfile $PID
2015-10-05 13:06:28 +02:00
RETVAL=$?
2006-02-23 16:26:10 +01:00
;;
restart)
$0 stop
$0 start
;;
2015-03-05 11:09:54 +01:00
reload)
$SSD --stop --signal USR1 --pidfile $PID
2015-10-05 13:06:28 +02:00
RETVAL=$?
2015-03-05 11:09:54 +01:00
;;
status)
$SSD --status --pidfile $PID
case $? in
2015-06-27 15:55:13 +02:00
0) echo "$PROG is running with pid $(cat $PID)" ;;
2015-03-05 11:09:54 +01:00
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-03-05 11:09:54 +01:00
echo "usage: $0 [start|stop|restart|reload|status]"
2006-02-23 16:26:10 +01:00
;;
esac
2015-10-05 13:06:28 +02:00
exit $RETVAL
2006-02-23 16:26:10 +01:00
# End of file