summaryrefslogtreecommitdiff
path: root/source/a/dcron/rc.crond
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/dcron/rc.crond')
-rw-r--r--source/a/dcron/rc.crond40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/a/dcron/rc.crond b/source/a/dcron/rc.crond
new file mode 100644
index 00000000..c9c94ec8
--- /dev/null
+++ b/source/a/dcron/rc.crond
@@ -0,0 +1,40 @@
+#!/bin/sh
+# /etc/rc.d/rc.crond - start/stop the cron daemon
+
+# To change the default options, edit /etc/default/crond.
+if [ -r /etc/default/crond ]; then
+ . /etc/default/crond
+fi
+
+start_crond() {
+ if ! /usr/bin/pgrep --ns $$ --exact crond 1> /dev/null 2> /dev/null ; then
+ echo "Starting crond: /usr/sbin/crond $CROND_OPTS"
+ mkdir -p /run/cron
+ /usr/sbin/crond $CROND_OPTS
+ fi
+}
+
+stop_crond() {
+ echo "Stopping crond."
+ /usr/bin/pkill --ns $$ --exact crond 2> /dev/null
+}
+
+restart_crond() {
+ stop_crond
+ sleep 1
+ start_crond
+}
+
+case "$1" in
+'start')
+ start_crond
+ ;;
+'stop')
+ stop_crond
+ ;;
+'restart')
+ restart_crond
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac