#!/sbin/runscript # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-x86/sys-apps/xinetd/files/xinetd.rc6,v 1.13 2003/05/19 16:48:39 mholzer Exp $ opts="start stop reload restart dump check" DAEMONTOOLSDIR="/var/daemontools/xinetd" depend() { need net } start() { 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" 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 $? } reload(){ ebegin "Reloading configuration" killall -HUP xinetd &>/dev/null eend $? } dump(){ ebegin "Dumping configuration" killall -USR1 xinetd &>/dev/null eend $? } check(){ ebegin "Performing Consistency Check" killall -IOT xinetd &>/dev/null eend $? } status() { if [ -x /usr/bin/svok ] && /usr/bin/svok "$DAEMONTOOLSDIR" then einfo `/usr/bin/svstat "$DAEMONTOOLSDIR"` fi }