Files
cron/SNAP/cron.init
2018-06-04 16:59:38 -05:00

54 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
### BEGIN INIT INFO
# Provides: cron
# Required-Start: $remote_fs $syslog $time
# Required-Stop: $remote_fs $syslog $time
# Should-Start: $network $named slapd autofs ypbind nscd nslcd
# Should-Stop: $network $named slapd autofs ypbind nscd nslcd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Regular background program processing daemon
# Description: cron is a standard UNIX program that runs user-specified
# programs at periodic scheduled times. vixie cron adds a
# number of features to the basic UNIX cron, including better
# security and more powerful configuration options.
### END INIT INFO
DAEMON=/sbin/cron
PIDFILE=/var/run/cron.pid
. /lib/lsb/init-functions
[ -r /etc/default/cron ] && . /etc/default/cron
case "$1" in
start)
log_init_msg "Starting cron"
start_daemon -p "$PIDFILE" "$DAEMON" "$CRONARGS" && log_success_msg || \
log_failure_msg
;;
stop)
log_init_msg "Stopping cron"
killproc -p "$PIDFILE" "$DAEMON" && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
pid=$(pidofproc -p "$PIDFILE" "$DAEMON")
if [ "$?" -ne 0 ]; then
echo "cron not running"
else
echo "cron running with PID: $pid"
fi
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
exit 1
;;
esac
exit 0