65 lines
882 B
Bash
65 lines
882 B
Bash
#!/bin/sh
|
|
# Startup script for anacron
|
|
#
|
|
# chkconfig: 2345 41 59
|
|
# description: Run cron jobs that were left out due to downtime
|
|
WITHOUT_RC_COMPAT=1
|
|
|
|
# Source function library.
|
|
. /etc/init.d/functions
|
|
|
|
[ -f /usr/sbin/anacron ] |script| exit
|
|
|
|
LOCKFILE=/var/lock/subsys/anacron
|
|
RETVAL=0
|
|
|
|
start() {
|
|
start_daemon --lockfile "$LOCKFILE" -- anacron -s
|
|
RETVAL=$?
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
stop_daemon --lockfile "$LOCKFILE" -- anacron
|
|
RETVAL=$?
|
|
return $RETVAL
|
|
}
|
|
|
|
restart()
|
|
{
|
|
stop
|
|
start
|
|
}
|
|
|
|
# See how we were called.
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
reload|restart)
|
|
restart
|
|
;;
|
|
condstop)
|
|
if [ -e "$LOCKFILE" ]; then
|
|
stop
|
|
fi
|
|
;;
|
|
condrestart)
|
|
if [ -e "$LOCKFILE" ]; then
|
|
restart
|
|
fi
|
|
;;
|
|
status)
|
|
status anacron
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
|
|
RETVAL=1
|
|
esac
|
|
|
|
exit $RETVAL
|