updated on Wed Jan 25 12:16:47 UTC 2012
[aur-mirror.git] / dcron-maint / dcron.rc.d
blobb1a5770e6956f248b420fd6925b163deee7bb9ab
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/crond
7 PID=$(pidof -o %PPID /usr/sbin/crond)
8 case $1 in
9 start)
10 stat_busy "Starting Cron Daemon"
12 # defaults to using syslog, and sendmail-ing cron output to local user
13 # to mail output to remote address instead, add "-m user@host"
14 # to CROND_ARGS in /etc/conf.d/crond
15 if [[ -z $PID ]] && /usr/sbin/crond $CROND_ARGS; then
17 PID=$(pidof -o %PPID /usr/sbin/crond)
18 echo "$PID" > /var/run/crond.pid
19 add_daemon crond
20 stat_done
21 else
22 stat_fail
23 exit 1
27 stop)
28 stat_busy "Stopping Cron Daemon"
29 if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then
30 rm_daemon crond
31 stat_done
32 else
33 stat_fail
34 exit 1
38 restart)
39 $0 stop
40 $0 start
44 echo "Usage: $0 {start|stop|restart}" >&2
45 exit 1
47 esac