diff options
author | Colin Watson <cjwatson@debian.org> | 2018-10-21 10:36:27 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-10-21 10:38:28 +0100 |
commit | 02b3fee8901679a5e058f66691067675208a4ae5 (patch) | |
tree | 4285b09ce6cfd3226b1890972666015cb4aa030d /debian/openssh-server.if-up | |
parent | 2df9bff12640a33749f0f20ae806b6efac327116 (diff) |
Remove /etc/network/if-up.d/openssh-server
It causes more problems than it solves.
Add an "if-up hook removed" section to README.Debian documenting the
corner case that may need configuration adjustments.
Thanks, Christian Ehrhardt, Andreas Hasenack, and David Britton.
Closes: #789532
LP: #1037738, #1674330, #1718227
Diffstat (limited to 'debian/openssh-server.if-up')
-rw-r--r-- | debian/openssh-server.if-up | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up deleted file mode 100644 index 525c2153b..000000000 --- a/debian/openssh-server.if-up +++ /dev/null | |||
@@ -1,42 +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 /run/sshd.pid ] || \ | ||
29 | [ "$(ps -p "$(cat /run/sshd.pid)" -o comm=)" != sshd ]; then | ||
30 | exit 0 | ||
31 | fi | ||
32 | |||
33 | # We'd like to use 'reload' here, but it has some problems; see #502444. On | ||
34 | # the other hand, repeated restarts of ssh make systemd unhappy | ||
35 | # (#756547/#757822), so use reload in that case. | ||
36 | if [ -d /run/systemd/system ]; then | ||
37 | systemctl reload --no-block ssh.service >/dev/null 2>&1 || true | ||
38 | else | ||
39 | invoke-rc.d ssh restart >/dev/null 2>&1 || true | ||
40 | fi | ||
41 | |||
42 | exit 0 | ||