--- fcron 2003-09-17 13:04:28.000000000 +1000 +++ fcron-new 2003-09-17 13:12:20.000000000 +1000 @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /home/cvsroot/gentoo-x86/sys-apps/fcron/files/fcron.rc6,v 1.2 2003/02/14 23:25:37 vapier Exp $ +DAEMONTOOLSDIR="/var/daemontools/fcron" + depend() { need clock hostname logger provide cron @@ -18,13 +20,34 @@ start() { checkconfig || return 1 - ebegin "Starting fcron" - start-stop-daemon --start --quiet --exec /usr/sbin/fcron + if [ -x /usr/bin/svc ] && [ -x "${DAEMONTOOLSDIR}/run" ] \ + && [ ! -f "${DAEMONTOOLSDIR}/noinit" ] + then + ebegin "Starting supervised fcron" + /usr/bin/pgrphack /usr/bin/supervise "$DAEMONTOOLSDIR" | \ + /usr/bin/pgrphack /usr/bin/supervise "$DAEMONTOOLSDIR"/log & + else + ebegin "Starting fcron" + start-stop-daemon --start --quiet --exec /usr/sbin/fcron + fi eend $? } stop() { ebegin "Stopping fcron" - start-stop-daemon --stop --quiet --pidfile /var/run/fcron.pid + if [ -x /usr/bin/svok ] && /usr/bin/svok "$DAEMONTOOLSDIR" + then + /usr/bin/svc -dx "$DAEMONTOOLSDIR" "$DAEMONTOOLSDIR"/log + else + start-stop-daemon --stop --quiet --pidfile /var/run/fcron.pid + fi eend $? } + +status() { + if [ -x /usr/bin/svok ] && /usr/bin/svok "$DAEMONTOOLSDIR" + then + einfo `/usr/bin/svstat "$DAEMONTOOLSDIR"` + einfo `/usr/bin/svstat "${DAEMONTOOLSDIR}/log"` + fi +}