summaryrefslogtreecommitdiff
path: root/dcron
diff options
context:
space:
mode:
authorJuergen Daubert <jue@jue.li>2015-06-26 17:12:32 +0200
committerJuergen Daubert <jue@jue.li>2015-06-26 17:12:32 +0200
commit53c69caf352972a5000ab54ed65434029b15a733 (patch)
tree621354c071cfb21e4f3497be41a7690d44be6efa /dcron
parente119639ec5dc44238d765f0301d124cb8f77658e (diff)
downloadcore-53c69caf352972a5000ab54ed65434029b15a733.tar.gz
core-53c69caf352972a5000ab54ed65434029b15a733.tar.xz
dcron: improved rc script
Diffstat (limited to 'dcron')
-rw-r--r--dcron/Pkgfile2
-rwxr-xr-xdcron/crond20
2 files changed, 17 insertions, 5 deletions
diff --git a/dcron/Pkgfile b/dcron/Pkgfile
index 5e9c99a0..cea3444a 100644
--- a/dcron/Pkgfile
+++ b/dcron/Pkgfile
@@ -4,7 +4,7 @@
name=dcron
version=4.5
-release=1
+release=2
source=(http://www.jimpryor.net/linux/releases/$name-$version.tar.gz \
crontab runjobs crond)
diff --git a/dcron/crond b/dcron/crond
index 732889c0..7b52a123 100755
--- a/dcron/crond
+++ b/dcron/crond
@@ -3,20 +3,32 @@
# /etc/rc.d/crond: start/stop cron daemon
#
+SSD=/sbin/start-stop-daemon
+PROG=/usr/sbin/crond
+OPTS="-S -l info"
+
case $1 in
start)
- /usr/sbin/crond -S -l info
+ $SSD --start --exec $PROG -- $OPTS
;;
stop)
- killall -q /usr/sbin/crond
+ $SSD --stop --retry 10 --exec $PROG
;;
restart)
$0 stop
- sleep 2
$0 start
;;
+status)
+ $SSD --status --exec $PROG
+ case $? in
+ 0) echo "$PROG is running with pid $(pidof $PROG)" ;;
+ 1) echo "$PROG is not running but the pid file $PID exists" ;;
+ 3) echo "$PROG is not running" ;;
+ 4) echo "Unable to determine the program status" ;;
+ esac
+ ;;
*)
- echo "usage: $0 [start|stop|restart]"
+ echo "usage: $0 [start|stop|restart|status]"
;;
esac

Generated by cgit