diff options
author | Colin Watson <cjwatson@debian.org> | 2003-09-01 00:51:03 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-09-01 00:51:03 +0000 |
commit | 79cf0b3654d7b597de323153eb57015cdfbd90a4 (patch) | |
tree | 274e78bc3369e218e59aa1fcc9b7e90697f424f1 /debian/init | |
parent | d984a3c6658e950881edcfb2aae464add93f68d4 (diff) |
Debian release 3.4p1-1.
Diffstat (limited to 'debian/init')
-rw-r--r-- | debian/init | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/init b/debian/init new file mode 100644 index 000000000..fe59584e6 --- /dev/null +++ b/debian/init | |||
@@ -0,0 +1,60 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | # /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon | ||
4 | |||
5 | test -x /usr/sbin/sshd || exit 0 | ||
6 | ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 | ||
7 | |||
8 | # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists | ||
9 | if [ -e /etc/ssh/sshd_not_to_be_run ]; then | ||
10 | echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" | ||
11 | exit 0 | ||
12 | fi | ||
13 | |||
14 | check_config() { | ||
15 | /usr/sbin/sshd -t || exit 1 | ||
16 | } | ||
17 | |||
18 | # Configurable options: | ||
19 | |||
20 | case "$1" in | ||
21 | start) | ||
22 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | ||
23 | #Create the PrivSep empty dir if necessary | ||
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" | ||
28 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd | ||
29 | echo "." | ||
30 | ;; | ||
31 | stop) | ||
32 | echo -n "Stopping OpenBSD Secure Shell server: sshd" | ||
33 | start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid | ||
34 | echo "." | ||
35 | ;; | ||
36 | |||
37 | reload|force-reload) | ||
38 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | ||
39 | check_config | ||
40 | 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 | ||
42 | echo "." | ||
43 | ;; | ||
44 | |||
45 | restart) | ||
46 | test -f /etc/ssh/sshd_not_to_be_run && exit 0 | ||
47 | check_config | ||
48 | echo -n "Restarting OpenBSD Secure Shell server: sshd" | ||
49 | start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid | ||
50 | sleep 2 | ||
51 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd | ||
52 | echo "." | ||
53 | ;; | ||
54 | |||
55 | *) | ||
56 | echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" | ||
57 | exit 1 | ||
58 | esac | ||
59 | |||
60 | exit 0 | ||