diff options
author | Colin Watson <cjwatson@debian.org> | 2013-05-22 01:45:40 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-05-22 01:45:40 +0100 |
commit | 6e950945da7a2acbb48fa4138208018f09d66991 (patch) | |
tree | 1e99c1fb54755277a8c441cf503b71bb2c5be748 /debian/openssh-server.if-up.in | |
parent | afd3292952a9f0bb107046785ddcfad446d69b89 (diff) |
Switch to new unified layout for Upstart jobs as documented in
https://wiki.ubuntu.com/UpstartCompatibleInitScripts: the init script
checks for a running Upstart, and we now let dh_installinit handle most
of the heavy lifting in maintainer scripts. Ubuntu users should be
essentially unaffected except that sshd may no longer start
automatically in chroots if the running Upstart predates 0.9.0; but the
main goal is simply not to break when openssh-server is installed in a
chroot.
Diffstat (limited to 'debian/openssh-server.if-up.in')
-rw-r--r-- | debian/openssh-server.if-up.in | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/debian/openssh-server.if-up.in b/debian/openssh-server.if-up.in deleted file mode 100644 index 871493068..000000000 --- a/debian/openssh-server.if-up.in +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #! /bin/sh | ||
2 | # Reload the OpenSSH server when an interface comes up, to allow it to start | ||
3 | # listening on new addresses. | ||
4 | |||
5 | set -e | ||
6 | |||
7 | # Don't bother to restart sshd when lo is configured. | ||
8 | if [ "$IFACE" = lo ]; then | ||
9 | exit 0 | ||
10 | fi | ||
11 | |||
12 | # Only run from ifup. | ||
13 | if [ "$MODE" != start ]; then | ||
14 | exit 0 | ||
15 | fi | ||
16 | |||
17 | # OpenSSH only cares about inet and inet6. Get ye gone, strange people | ||
18 | # still using ipx. | ||
19 | if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then | ||
20 | exit 0 | ||
21 | fi | ||
22 | |||
23 | # Is /usr mounted? | ||
24 | if [ ! -e /usr/sbin/sshd ]; then | ||
25 | exit 0 | ||
26 | fi | ||
27 | |||
28 | if [ ! -f /var/run/sshd.pid ] || \ | ||
29 | [ "$(ps -p "$(cat /var/run/sshd.pid)" -o comm=)" != sshd ]; then | ||
30 | exit 0 | ||
31 | fi | ||
32 | |||
33 | case '@DISTRIBUTOR@' in | ||
34 | Ubuntu) | ||
35 | # Both init script and Upstart job are present; we want to operate | ||
36 | # on the Upstart job. | ||
37 | stop ssh || true | ||
38 | start ssh || true | ||
39 | ;; | ||
40 | *) | ||
41 | # We'd like to use 'reload' here, but it has some problems; see | ||
42 | # #502444. | ||
43 | if [ -x /usr/sbin/invoke-rc.d ]; then | ||
44 | invoke-rc.d ssh restart >/dev/null 2>&1 || true | ||
45 | else | ||
46 | /etc/init.d/ssh restart >/dev/null 2>&1 || true | ||
47 | fi | ||
48 | ;; | ||
49 | esac | ||
50 | |||
51 | exit 0 | ||