3 # crond Start/Stop the cron clock daemon.
5 # chkconfig: 2345 90 60
6 # description: cron is a standard UNIX program that runs user-specified \
7 # programs at periodic scheduled times. vixie cron adds a \
8 # number of features to the basic UNIX cron, including better \
9 # security and more powerful configuration options.
12 # Provides: crond crontab
13 # Required-Start: $local_fs $syslog
14 # Required-Stop: $local_fs $syslog
17 # Short-Description: run cron daemon
18 # Description: cron is a standard UNIX program that runs user-specified
19 # programs at periodic scheduled times. vixie cron adds a
20 # number of features to the basic UNIX cron, including better
21 # security and more powerful configuration options.
24 [ -f /etc/sysconfig/crond ] || {
25 [ "$1" = "status" ] && exit 4 || exit 6
31 lockfile=/var/lock/subsys/crond
32 config=/etc/sysconfig/crond
34 # Source function library.
35 . /etc/rc.d/init.d/functions
37 [ $UID -eq 0 ] && [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
40 if [ $(id -ru) -ne 0 ] ; then
41 echo "User has insufficient privilege."
44 [ -x $exec ] || exit 5
45 [ -f $config ] || exit 6
46 printf "Starting $prog: "
47 daemon $prog $CRONDARGS
50 [ $retval -eq 0 ] && touch $lockfile
54 if [ $(id -ru) -ne 0 ] ; then
55 echo "User has insufficient privilege."
58 printf "Stopping $prog: "
59 if [ -n "`pidfileofproc $exec`" ]; then
63 failure "Stopping $prog"
67 [ $retval -eq 0 ] && rm -f $lockfile
76 printf "Reloading $prog: "
77 if [ -n "`pidfileofproc $exec`" ]; then
80 failure "Reloading $prog"
87 # new configuration takes effect after restart
92 # run checks to determine if the service is running or use generic status
93 status -p /var/run/crond.pid $prog
97 rh_status >/dev/null 2>&1
103 rh_status_q && exit 0
107 rh_status_q || exit 0
114 rh_status_q || exit 7
123 condrestart|try-restart)
124 rh_status_q || exit 0
128 echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"