summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-12 18:05:07 +0000
committerColin Watson <cjwatson@debian.org>2007-06-12 18:05:07 +0000
commit06a338593c752686cd41db37648a53b593e9f55f (patch)
tree69bbd8d50ffa6844f36958ca0c3f5febaf97bde8 /debian
parentbe510142eba95a25ede7e2713a6c11e9520800d5 (diff)
* Use LSB functions in init scripts, and add an LSB-style header (thanks,
Christian Perrier; closes: #389038).
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog2
-rw-r--r--debian/control2
-rw-r--r--debian/openssh-server.init63
3 files changed, 51 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog
index 3a74c5d0c..babd4571d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -56,6 +56,8 @@ openssh (1:4.6p1-1) UNRELEASED; urgency=low
56 http://www.sxw.org.uk/computing/patches/openssh-4.6p1-gsskex-20070312.patch; 56 http://www.sxw.org.uk/computing/patches/openssh-4.6p1-gsskex-20070312.patch;
57 install ChangeLog.gssapi. 57 install ChangeLog.gssapi.
58 * Build the .deb --with-ssl-engine (LP: #119295). 58 * Build the .deb --with-ssl-engine (LP: #119295).
59 * Use LSB functions in init scripts, and add an LSB-style header (thanks,
60 Christian Perrier; closes: #389038).
59 61
60 -- Colin Watson <cjwatson@ubuntu.com> Tue, 12 Jun 2007 14:31:01 +0100 62 -- Colin Watson <cjwatson@ubuntu.com> Tue, 12 Jun 2007 14:31:01 +0100
61 63
diff --git a/debian/control b/debian/control
index b266750ad..10ca6ad8f 100644
--- a/debian/control
+++ b/debian/control
@@ -36,7 +36,7 @@ Description: secure shell client, an rlogin/rsh/rcp replacement
36Package: openssh-server 36Package: openssh-server
37Priority: optional 37Priority: optional
38Architecture: any 38Architecture: any
39Depends: ${shlibs:Depends}, ${debconf-depends}, ${pam-depends}, libpam-modules (>= 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), openssh-client (= ${Source-Version}) 39Depends: ${shlibs:Depends}, ${debconf-depends}, ${pam-depends}, libpam-modules (>= 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), openssh-client (= ${Source-Version}), lsb-base (>= 3.0-6)
40Conflicts: ssh (<< 1:3.8.1p1-9), ssh-nonfree (<<2), ssh-socks, ssh2, sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7) 40Conflicts: ssh (<< 1:3.8.1p1-9), ssh-nonfree (<<2), ssh-socks, ssh2, sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7)
41Replaces: ssh, openssh-client (<< 1:3.8.1p1-11), ssh-krb5 41Replaces: ssh, openssh-client (<< 1:3.8.1p1-11), ssh-krb5
42Suggests: ssh-askpass, xbase-clients, rssh, molly-guard 42Suggests: ssh-askpass, xbase-clients, rssh, molly-guard
diff --git a/debian/openssh-server.init b/debian/openssh-server.init
index f93150390..6fd04bb74 100644
--- a/debian/openssh-server.init
+++ b/debian/openssh-server.init
@@ -1,4 +1,13 @@
1#! /bin/sh 1#! /bin/sh
2
3### BEGIN INIT INFO
4# Provides: sshd
5# Required-Start: $network $local_fs $remote_fs
6# Required-Stop:
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9### END INIT INFO
10
2set -e 11set -e
3 12
4# /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon 13# /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon
@@ -10,10 +19,22 @@ if test -f /etc/default/ssh; then
10 . /etc/default/ssh 19 . /etc/default/ssh
11fi 20fi
12 21
22. /lib/lsb/init-functions
23
24# Are we running from init?
25run_by_init() {
26 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
27}
28
13check_for_no_start() { 29check_for_no_start() {
14 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists 30 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
15 if [ -e /etc/ssh/sshd_not_to_be_run ]; then 31 if [ -e /etc/ssh/sshd_not_to_be_run ]; then
16 echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" 32 if [ "$1" = log_end_msg ]; then
33 log_end_msg 0
34 fi
35 if ! run_by_init; then
36 log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)"
37 fi
17 exit 0 38 exit 0
18 fi 39 fi
19} 40}
@@ -37,37 +58,49 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
37case "$1" in 58case "$1" in
38 start) 59 start)
39 check_for_no_start 60 check_for_no_start
61 log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd"
40 check_privsep_dir 62 check_privsep_dir
41 echo -n "Starting OpenBSD Secure Shell server: sshd" 63 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
42 start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS 64 log_end_msg 0
43 echo "." 65 else
66 log_end_msg 1
67 fi
44 ;; 68 ;;
45 stop) 69 stop)
46 echo -n "Stopping OpenBSD Secure Shell server: sshd" 70 log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd"
47 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid 71 if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
48 echo "." 72 log_end_msg 0
73 else
74 log_end_msg 1
75 fi
49 ;; 76 ;;
50 77
51 reload|force-reload) 78 reload|force-reload)
52 check_for_no_start 79 check_for_no_start
53 check_config 80 check_config
54 echo -n "Reloading OpenBSD Secure Shell server's configuration" 81 log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd"
55 start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd 82 if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then
56 echo "." 83 log_end_msg 0
84 else
85 log_end_msg 1
86 fi
57 ;; 87 ;;
58 88
59 restart) 89 restart)
60 check_privsep_dir 90 check_privsep_dir
61 check_config 91 check_config
62 echo -n "Restarting OpenBSD Secure Shell server: sshd" 92 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
63 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid 93 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid
64 check_for_no_start 94 check_for_no_start log_end_msg
65 start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS 95 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
66 echo "." 96 log_end_msg 0
97 else
98 log_end_msg 1
99 fi
67 ;; 100 ;;
68 101
69 *) 102 *)
70 echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" 103 log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}"
71 exit 1 104 exit 1
72esac 105esac
73 106