From 46c98ffaac1a75641e3c98bd9418c2e0c9ce0696 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 22 May 2013 17:41:59 +0100 Subject: 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. --- debian/changelog | 10 ++++++++++ debian/openssh-server.postinst | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 640a8e0bb..3ad191a02 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +openssh (1:6.2p2-3) UNRELEASED; urgency=low + + * 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. + + -- Colin Watson Wed, 22 May 2013 15:59:14 +0100 + openssh (1:6.2p2-2) unstable; urgency=low * Change start condition of Upstart job to be just the standard "runlevel 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 if dpkg --compare-versions "$2" lt 1:5.5p1-6; then rm -f /var/run/sshd/.placeholder fi + if dpkg --compare-versions "$2" lt 1:6.2p2-3 && \ + which initctl >/dev/null && initctl version | grep -q upstart && \ + ! status ssh 2>/dev/null | grep -q ' start/'; then + # We must stop the sysvinit-controlled sshd before we can + # restart it under Upstart. + start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid || true + fi fi #DEBHELPER# -- cgit v1.2.3