kumquat-buildroot/package/dcron/S90dcron
Alvaro G. M 994e9fa72e dcron: provide init script
dcron doesn't create a pid file, so we run it in foreground but make
start-stop-daemon create the pidfile and move the daemon to background.

Give it a number greater than exim's init script, so job output email
can be sent.

[Thomas: as suggested by Yann E. Morin, use DCRON_INSTALL_INIT_SYSV.]

Signed-off-by: Alvaro G. M <alvaro.gamez@hazent.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-17 20:59:46 +02:00

23 lines
371 B
Bash

#!/bin/sh
case "$1" in
start)
echo -n "Starting cron ... "
start-stop-daemon -S -q -m -b -p /var/run/dcron.pid --exec /usr/sbin/crond -- -f
echo "done."
;;
stop)
echo -n "Stopping cron ..."
start-stop-daemon -K -q -p /var/run/dcron.pid
echo "done."
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac