summaryrefslogtreecommitdiff
path: root/core/cronie/rc.d
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-05-05 19:02:44 +0000
committerroot <root@rshg047.dnsready.net>2011-05-05 19:02:44 +0000
commitef61aa5a9cead170fa18dba44609c32bbf18306a (patch)
tree82af53ec1018f58868b80cdf680a9c4ec5df1538 /core/cronie/rc.d
parentab1410d33401cf1fc4a384bb0b2d9901c8fe8d14 (diff)
Thu May 5 19:02:44 UTC 2011
Diffstat (limited to 'core/cronie/rc.d')
-rwxr-xr-xcore/cronie/rc.d38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/cronie/rc.d b/core/cronie/rc.d
new file mode 100755
index 000000000..d0659685c
--- /dev/null
+++ b/core/cronie/rc.d
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+name=crond
+. /etc/conf.d/crond
+PID=$(pidof -o %PPID /usr/sbin/crond)
+
+case "$1" in
+start)
+ stat_busy "Starting $name daemon"
+ [[ -z "$PID" ]] && /usr/sbin/crond $CRONDARGS &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && kill $PID &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+reload)
+ stat_busy "Reloading $name daemon"
+ [[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \
+ && { stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart|reload}"
+ ;;
+esac
+exit 0