2018-06-13 07:43:00 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# /etc/rc.d/rc.atd - start/stop the at daemon
|
|
|
|
|
|
|
|
# To change the default options, edit /etc/default/atd.
|
|
|
|
if [ -r /etc/default/atd ]; then
|
|
|
|
. /etc/default/atd
|
|
|
|
fi
|
|
|
|
|
|
|
|
start_atd() {
|
2018-06-15 02:03:49 +02:00
|
|
|
if ! /usr/bin/pgrep --ns $$ --euid daemon -f "^/usr/sbin/atd" 1> /dev/null 2> /dev/null ; then
|
2018-06-13 07:43:00 +02:00
|
|
|
echo "Starting atd: /usr/sbin/atd $ATD_OPTS"
|
2018-06-13 23:55:19 +02:00
|
|
|
/usr/sbin/atd $ATD_OPTS
|
2018-06-13 07:43:00 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop_atd() {
|
|
|
|
echo "Stopping atd."
|
2018-06-15 02:03:49 +02:00
|
|
|
/usr/bin/pkill --ns $$ --euid daemon -f "^/usr/sbin/atd" 2> /dev/null
|
2018-06-13 07:43:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
restart_atd() {
|
|
|
|
stop_atd
|
|
|
|
sleep 1
|
|
|
|
start_atd
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
'start')
|
|
|
|
start_atd
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
stop_atd
|
|
|
|
;;
|
|
|
|
'restart')
|
|
|
|
restart_atd
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage $0 start|stop|restart"
|
|
|
|
esac
|