summaryrefslogtreecommitdiff
path: root/debian/openssh-server.if-up
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-01-13 20:18:14 +0000
committerColin Watson <cjwatson@debian.org>2009-01-13 20:18:14 +0000
commit78a89e637c337e240678de3d1c0f1486b3affb93 (patch)
treeb4b030fa792cc32b5cceae77fb99d98bdb6882b6 /debian/openssh-server.if-up
parent92863e5802abcf84a0c778e2cfd52def42d19f89 (diff)
Check that /var/run/sshd.pid exists and that the process ID listed there
corresponds to sshd before running '/etc/init.d/ssh reload' from if-up script; SIGHUP is racy if called at boot before sshd has a chance to install its signal handler, but fortunately the pid file is written after that which lets us avoid the race (closes: #502444).
Diffstat (limited to 'debian/openssh-server.if-up')
-rw-r--r--debian/openssh-server.if-up5
1 files changed, 5 insertions, 0 deletions
diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up
index c44a4d257..9b2140352 100644
--- a/debian/openssh-server.if-up
+++ b/debian/openssh-server.if-up
@@ -25,6 +25,11 @@ if [ ! -e /usr/sbin/sshd ]; then
25 exit 0 25 exit 0
26fi 26fi
27 27
28if [ ! -f /var/run/sshd.pid ] || \
29 [ "$(ps -p "$(cat /var/run/sshd.pid)" -o comm=)" = sshd ]; then
30 exit 0
31fi
32
28/etc/init.d/ssh reload >/dev/null 2>&1 || true 33/etc/init.d/ssh reload >/dev/null 2>&1 || true
29 34
30exit 0 35exit 0