Sophie

Sophie

distrib > Mandriva > mes5 > i586 > by-pkgid > ba754d7c5d4927bd9ce143727017ec81 > files > 3

vixie-cron-4.3-6mdv2009.0.src.rpm

#! /bin/bash
#
# crond          Start/Stop the cron clock daemon.
#
# chkconfig: 2345 90 60
# description: cron is a standard UNIX program that runs user-specified \
#              programs at periodic scheduled times. vixie cron adds a \
#              number of features to the basic UNIX cron, including better \
#              security and more powerful configuration options.
# processname: crond
# config: /etc/crontab
# pidfile: /var/run/crond.pid
#
### BEGIN INIT INFO
# Provides: crond
# Required-Start: $syslog
# Should-Start: network-auth
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Short-Description: The cron clock daemon
# Description: cron is a standard UNIX program that runs user-specified
#              programs at periodic scheduled times. vixie cron adds a
#              number of features to the basic UNIX cron, including better
#              security and more powerful configuration options.
### END INIT INFO

# Source function library.
. /etc/init.d/functions

RETVAL=0

# See how we were called.
  
prog="crond"

start() {
	echo -n $"Starting $prog: "
	daemon crond < /dev/null
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc crond
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/crond
	return $RETVAL
}	

rhstatus() {
	status crond
}	

restart() {
  	stop
	start
}	

reload() {
	echo -n $"Reloading cron 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 || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
	exit 1
esac

exit $?