#!/bin/sh # /etc/rc.d/rc.crond - start/stop the cron daemon # To change the default options, edit /etc/default/crond. # If /etc/rc.d/rc.cron is executable, run it instead. if [ -r /etc/default/crond ]; then . /etc/default/crond fi start_crond() { if [ -x /etc/rc.d/rc.fcron ]; then /etc/rc.d/rc.fcron start elif ! /usr/bin/pgrep --ns $$ --euid root -f "^/usr/sbin/crond" 1> /dev/null 2> /dev/null ; then echo "Starting crond: /usr/sbin/crond $CROND_OPTS" mkdir -p /run/cron /usr/sbin/crond $CROND_OPTS fi } stop_crond() { if [ -x /etc/rc.d/rc.fcron ]; then /etc/rc.d/rc.fcron stop else echo "Stopping crond." /usr/bin/pkill --ns $$ --euid root -f "^/usr/sbin/crond" 2> /dev/null fi } restart_crond() { if [ ! -x /etc/rc.d/rc.fcron ]; then stop_crond sleep 1 start_crond fi } case "$1" in 'start') start_crond ;; 'stop') stop_crond ;; 'restart') restart_crond ;; *) if [ ! -x /etc/rc.d/rc.fcron ]; then echo "usage fcron start|stop" else echo "usage $0 start|stop|restart" fi esac