Initial commit: Uploaded everything from abs/core
[arch-rock.git] / base / dcron / crond
blobef80db31d3c4f853d0260b4878cb89e68d1a19fd
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/sbin/crond`
7 case "$1" in
8 start)
9 stat_busy "Starting Cron Daemon"
10 [ -z "$PID" ] && /usr/sbin/crond >>/var/log/crond 2>&1
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 PID=`pidof -o %PPID /usr/sbin/crond`
15 echo $PID >/var/run/crond.pid
16 add_daemon crond
17 stat_done
20 stop)
21 stat_busy "Stopping Cron Daemon"
22 [ ! -z "$PID" ] && kill $PID &>/dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon crond
27 stat_done
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0