mcst-linux-kernel/patches-2024.06.26/at-3.2.1/files/etc.mcst/init.d/atd

57 lines
911 B
Bash
Executable File

#!/bin/bash
#
# /etc/rc.d/init.d/atd
#
# Starts the at daemon
. /etc/sysconfig/rc
. ${rc_functions}
test -x /usr/sbin/atd || exit 0
RETVAL=0
#
# See how we were called.
#
case "$1" in
start)
if [ ! -f /var/lock/subsys/atd ]; then
boot_mesg $"Starting atd... "
loadproc /usr/sbin/atd
pidof /usr/sbin/atd >/dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/atd
fi
;;
stop)
boot_mesg $"Stopping atd... "
killproc /usr/sbin/atd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/atd
;;
reload|restart)
${0} stop
sleep 1
${0} start
;;
condrestart)
if [ -f /var/lock/subsys/atd ]; then
${0} restart
fi
;;
status)
statusproc /usr/sbin/atd
exit $?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
#exit $?
#exit $RETVAL
exit 0