--- xinetd 2003-09-17 13:25:13.000000000 +1000 +++ xinetd-new 2003-09-17 13:15:35.000000000 +1000 @@ -5,20 +5,34 @@ opts="start stop reload restart dump check" +DAEMONTOOLSDIR="/var/daemontools/xinetd" + depend() { need net } start() { - ebegin "Starting xinetd" - start-stop-daemon --start --quiet --exec /usr/sbin/xinetd \ - -- -pidfile /var/run/xinetd.pid ${XINETD_OPTS} - eend $? + if [ -x /usr/bin/svc ] && [ -x "${DAEMONTOOLSDIR}/run" ] \ + && [ ! -f "${DAEMONTOOLSDIR}/noinit" ] + then + ebegin "Starting supervised xinetd" + /usr/bin/pgrphack /usr/bin/supervise "$DAEMONTOOLSDIR" & + else + ebegin "Starting xinetd" + start-stop-daemon --start --quiet --exec /usr/sbin/xinetd \ + -- -pidfile /var/run/xinetd.pid ${XINETD_OPTS} + fi + eend $? } stop() { ebegin "Stopping xinetd" - start-stop-daemon --stop --quiet --pidfile /var/run/xinetd.pid + if [ -x /usr/bin/svok ] && /usr/bin/svok "$DAEMONTOOLSDIR" + then + /usr/bin/svc -dx "$DAEMONTOOLSDIR" + else + start-stop-daemon --stop --quiet --pidfile /var/run/xinetd.pid + fi eend $? } @@ -39,3 +53,10 @@ killall -IOT xinetd &>/dev/null eend $? } + +status() { + if [ -x /usr/bin/svok ] && /usr/bin/svok "$DAEMONTOOLSDIR" + then + einfo `/usr/bin/svstat "$DAEMONTOOLSDIR"` + fi +}