#!/bin/bash # # crond Start/Stop the dcron clock daemon. # # chkconfig: 2345 90 60 # description: dcron is a standard UNIX program that runs user-specified \ # programs at periodic scheduled times. # processname: crond # config: /etc/crontab # pidfile: /var/run/dcron/dcron.pid # Source function library. . /etc/init.d/functions RETVAL=0 # See how we were called. start() { gprintf "Starting dcron: " daemon crond RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond return $RETVAL } stop() { gprintf "Stopping dcron: " killproc crond RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/crond return $RETVAL } rhstatus() { status crond } restart() { stop start } reload() { gprintf "Reloading dcron daemon configuration: " killproc crond -HUP retval=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) rhstatus ;; condrestart) [ -f /var/lock/subsys/crond ] && restart || : ;; *) gprintf "Usage: dcron {start|stop|status|reload|restart|condrestart}\n" exit 1 esac exit $?