summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-05-22 17:41:59 +0100
committerColin Watson <cjwatson@debian.org>2013-05-22 17:41:59 +0100
commit46c98ffaac1a75641e3c98bd9418c2e0c9ce0696 (patch)
treeb938d0083647a3a1563bb8e218500c8531ac9715 /debian/openssh-server.postinst
parent549dcbef02553fc7d6b975a157871b6dae937e26 (diff)
If the running init daemon is Upstart, then, on the first upgrade to
this version, check whether sysvinit is still managing sshd; if so, manually stop it so that it can be restarted under upstart. We do this near the end of the postinst, so it shouldn't result in any appreciable extra window where sshd is not running during upgrade.
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r--debian/openssh-server.postinst7
1 files changed, 7 insertions, 0 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index a438a4e06..087a7125e 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -279,6 +279,13 @@ if [ "$action" = configure ]; then
279 if dpkg --compare-versions "$2" lt 1:5.5p1-6; then 279 if dpkg --compare-versions "$2" lt 1:5.5p1-6; then
280 rm -f /var/run/sshd/.placeholder 280 rm -f /var/run/sshd/.placeholder
281 fi 281 fi
282 if dpkg --compare-versions "$2" lt 1:6.2p2-3 && \
283 which initctl >/dev/null && initctl version | grep -q upstart && \
284 ! status ssh 2>/dev/null | grep -q ' start/'; then
285 # We must stop the sysvinit-controlled sshd before we can
286 # restart it under Upstart.
287 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid || true
288 fi
282fi 289fi
283 290
284#DEBHELPER# 291#DEBHELPER#