From 7eff9df1678223e1a3427ba621f6c379386f9cce Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 1 Sep 2003 18:26:52 +0000 Subject: Debian release 3.5p1-4. --- debian/init | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'debian/init') diff --git a/debian/init b/debian/init index fe59584e6..ea39a8bd0 100644 --- a/debian/init +++ b/debian/init @@ -5,25 +5,32 @@ test -x /usr/sbin/sshd || exit 0 ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 -# forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists -if [ -e /etc/ssh/sshd_not_to_be_run ]; then - echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" - exit 0 -fi +check_for_no_start() { + # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists + if [ -e /etc/ssh/sshd_not_to_be_run ]; then + echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" + exit 0 + fi +} + +check_privsep_dir() { + # Create the PrivSep empty dir if necessary + if [ ! -d /var/run/sshd ]; then + mkdir /var/run/sshd + chmod 0755 /var/run/sshd + fi +} check_config() { /usr/sbin/sshd -t || exit 1 } -# Configurable options: +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" case "$1" in start) - test -f /etc/ssh/sshd_not_to_be_run && exit 0 -#Create the PrivSep empty dir if necessary - if [ ! -d /var/run/sshd ]; then - mkdir /var/run/sshd; chmod 0755 /var/run/sshd - fi + check_for_no_start + check_privsep_dir echo -n "Starting OpenBSD Secure Shell server: sshd" start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd echo "." @@ -35,7 +42,7 @@ case "$1" in ;; reload|force-reload) - test -f /etc/ssh/sshd_not_to_be_run && exit 0 + check_for_no_start check_config echo -n "Reloading OpenBSD Secure Shell server's configuration" start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd @@ -43,10 +50,11 @@ case "$1" in ;; restart) - test -f /etc/ssh/sshd_not_to_be_run && exit 0 check_config echo -n "Restarting OpenBSD Secure Shell server: sshd" start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid + check_for_no_start + check_privsep_dir sleep 2 start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd echo "." -- cgit v1.2.3