diff options
author | Colin Watson <cjwatson@debian.org> | 2003-09-01 18:26:52 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-09-01 18:26:52 +0000 |
commit | 7eff9df1678223e1a3427ba621f6c379386f9cce (patch) | |
tree | 2cb5d53b6db2efbc92ae3757c1c1145b60c063e1 /debian/init | |
parent | 0bb3622af79c6402a15e88ce1290cbc776392403 (diff) |
Debian release 3.5p1-4.
Diffstat (limited to 'debian/init')
-rw-r--r-- | debian/init | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/debian/init b/debian/init index fe59584e6..ea39a8bd0 100644 --- a/debian/init +++ b/debian/init | |||
@@ -5,25 +5,32 @@ | |||
5 | test -x /usr/sbin/sshd || exit 0 | 5 | test -x /usr/sbin/sshd || exit 0 |
6 | ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 | 6 | ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 |
7 | 7 | ||
8 | # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists | 8 | check_for_no_start() { |
9 | if [ -e /etc/ssh/sshd_not_to_be_run ]; then | 9 | # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists |
10 | echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" | 10 | if [ -e /etc/ssh/sshd_not_to_be_run ]; then |
11 | exit 0 | 11 | echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" |
12 | fi | 12 | exit 0 |
13 | fi | ||
14 | } | ||
15 | |||
16 | check_privsep_dir() { | ||
17 | # Create the PrivSep empty dir if necessary | ||
18 | if [ ! -d /var/run/sshd ]; then | ||
19 | mkdir /var/run/sshd | ||
20 | chmod 0755 /var/run/sshd | ||
21 | fi | ||
22 | } | ||
13 | 23 | ||
14 | check_config() { | 24 | check_config() { |
15 | /usr/sbin/sshd -t || exit 1 | 25 | /usr/sbin/sshd -t || exit 1 |
16 | } | 26 | } |
17 | 27 | ||
18 | # Configurable options: | 28 | export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" |
19 | 29 | ||
20 | case "$1" in | 30 | case "$1" in |
21 | start) | 31 | start) |
22 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | 32 | check_for_no_start |
23 | #Create the PrivSep empty dir if necessary | 33 | check_privsep_dir |
24 | if [ ! -d /var/run/sshd ]; then | ||
25 | mkdir /var/run/sshd; chmod 0755 /var/run/sshd | ||
26 | fi | ||
27 | echo -n "Starting OpenBSD Secure Shell server: sshd" | 34 | echo -n "Starting OpenBSD Secure Shell server: sshd" |
28 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd | 35 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd |
29 | echo "." | 36 | echo "." |
@@ -35,7 +42,7 @@ case "$1" in | |||
35 | ;; | 42 | ;; |
36 | 43 | ||
37 | reload|force-reload) | 44 | reload|force-reload) |
38 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | 45 | check_for_no_start |
39 | check_config | 46 | check_config |
40 | echo -n "Reloading OpenBSD Secure Shell server's configuration" | 47 | echo -n "Reloading OpenBSD Secure Shell server's configuration" |
41 | start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd | 48 | start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd |
@@ -43,10 +50,11 @@ case "$1" in | |||
43 | ;; | 50 | ;; |
44 | 51 | ||
45 | restart) | 52 | restart) |
46 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | ||
47 | check_config | 53 | check_config |
48 | echo -n "Restarting OpenBSD Secure Shell server: sshd" | 54 | echo -n "Restarting OpenBSD Secure Shell server: sshd" |
49 | start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid | 55 | start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid |
56 | check_for_no_start | ||
57 | check_privsep_dir | ||
50 | sleep 2 | 58 | sleep 2 |
51 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd | 59 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd |
52 | echo "." | 60 | echo "." |