Linux Atd
This script will start the atd daemon which runs commands at a specified time as scheduled by the "at" command. The directory /var/spool/at is used to store jobs.
The atd startup script
#!/bin/bash
#
# /etc/rc.d/init.d/atd
#
# Starts the at daemon
#
# chkconfig: 345 40 60
# description: Runs commands scheduled by the at command at the time \
# specified when at was run, and runs batch commands when the load \
# average is low enough.
# processname: atd
# Source function library.
. /etc/rc.d/init.d/functions
test -x /usr/sbin/atd || exit 0
RETVAL=0
#
# See how we were called.
#
case "$1" in
start)
# Check if atd is already running
if [ ! -f /var/lock/subsys/atd ]; then
echo -n 'Starting at daemon: '
daemon /usr/sbin/atd
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/atd
echo
fi
;;
stop)
echo -n 'Stopping at daemon: '
killproc /usr/sbin/atd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/atd
echo
;;
reload|restart)
$0 stop
$0 start
RETVAL=$?
;;
status)
status /usr/sbin/atd
RETVAL=$?
;;
*)
echo "Usage: /etc/rc.d/init.d/atd {start|stop|restart|reload|status}"
exit 1
esac
exit $RETVAL
|