--- sshd 2003-09-17 13:51:31.000000000 +1000 +++ sshd-new 2003-09-17 13:14:47.000000000 +1000 @@ -3,6 +3,7 @@ # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /home/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.10 2003/06/01 04:37:45 lostlogic Exp $ +DAEMONTOOLSDIR="/var/daemontools/sshd" depend() { use logger dns @@ -36,15 +37,35 @@ start() { checkconfig || return 1 - ebegin "Starting sshd" - start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \ - --startas /usr/sbin/sshd + if [ -x /usr/bin/svc ] && [ -x "${DAEMONTOOLSDIR}/run" ] \ + && [ ! -f "${DAEMONTOOLSDIR}/noinit" ] + then + ebegin "Starting supervised sshd" + /usr/bin/pgrphack /usr/bin/supervise "$DAEMONTOOLSDIR" | \ + /usr/bin/pgrphack /usr/bin/supervise "$DAEMONTOOLSDIR"/log & + else + ebegin "Starting sshd" + start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \ + --startas /usr/sbin/sshd + fi eend $? } stop() { ebegin "Stopping sshd" - start-stop-daemon --stop --quiet --pidfile /var/run/sshd.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/sshd.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 +}