3 # crond Start/Stop the cron clock daemon.
5 # chkconfig: 2345 40 60
6 # description: cron is a standard UNIX program that runs user-specified \
7 # programs at periodic scheduled times. cronie adds a \
8 # number of features to the basic UNIX cron, including better \
9 # security and more powerful configuration options.
13 # pidfile: /var/run/crond.pid
16 # Source function library.
17 . /etc/rc.d/init.d/functions
22 [ -f /etc/sysconfig/cron ] && . /etc/sysconfig/cron
25 # Check if the service is already running?
26 if [ -f /var/lock/subsys/crond ]; then
27 msg_already_running "cronie crond"
31 if is_yes "$CROND_SYSLOG_RESULT"; then
32 CROND_ARGS="$CROND_ARGS -s"
35 if [ -n "$CROND_MAIL_PROG" ]; then
36 # XXX: should we handle spaces in $CROND_MAIL_PROG?
37 CROND_ARGS="$CROND_ARGS -m $CROND_MAIL_PROG"
40 msg_starting "cronie crond"
41 daemon /usr/sbin/crond $CROND_ARGS
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
47 if [ ! -f /var/lock/subsys/crond ]; then
48 msg_not_running "cronie crond"
52 msg_stopping "cronie crond"
54 rm -f /var/lock/subsys/crond
58 if [ ! -f /var/lock/subsys/crond ]; then
59 msg_not_running "cronie crond"
64 msg_reloading "cronie crond"
70 if [ ! -f /var/lock/subsys/crond ]; then
71 msg_not_running "cronie crond"
81 # See how we were called.
96 reload|force-reload|flush-logs)
100 status --pidfile /var/run/crond.pid crond
104 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"