2018-06-13 07:43:00 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# /etc/rc.d/rc.crond - start/stop the cron daemon
|
|
|
|
|
|
|
|
# To change the default options, edit /etc/default/crond.
|
|
|
|
if [ -r /etc/default/crond ]; then
|
|
|
|
. /etc/default/crond
|
|
|
|
fi
|
|
|
|
|
|
|
|
start_crond() {
|
2018-06-15 02:03:49 +02:00
|
|
|
if ! /usr/bin/pgrep --ns $$ --euid root -f "^/usr/sbin/crond" 1> /dev/null 2> /dev/null ; then
|
2018-06-13 07:43:00 +02:00
|
|
|
echo "Starting crond: /usr/sbin/crond $CROND_OPTS"
|
|
|
|
mkdir -p /run/cron
|
|
|
|
/usr/sbin/crond $CROND_OPTS
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop_crond() {
|
|
|
|
echo "Stopping crond."
|
2018-06-15 02:03:49 +02:00
|
|
|
/usr/bin/pkill --ns $$ --euid root -f "^/usr/sbin/crond" 2> /dev/null
|
2018-06-13 07:43:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
restart_crond() {
|
|
|
|
stop_crond
|
|
|
|
sleep 1
|
|
|
|
start_crond
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
'start')
|
|
|
|
start_crond
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
stop_crond
|
|
|
|
;;
|
|
|
|
'restart')
|
|
|
|
restart_crond
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage $0 start|stop|restart"
|
|
|
|
esac
|