From 3ddd27842dfe7f5dd40feabf19cdc2cc7950c700 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 13 Aug 2014 00:59:50 +0100 Subject: Make the if-up hook use "reload" rather than "restart" if the system was booted using systemd (closes: #756547). --- debian/openssh-server.if-up | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'debian/openssh-server.if-up') diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up index de92866e6..dd05ea51c 100644 --- a/debian/openssh-server.if-up +++ b/debian/openssh-server.if-up @@ -30,8 +30,14 @@ if [ ! -f /var/run/sshd.pid ] || \ exit 0 fi -# We'd like to use 'reload' here, but it has some problems; see -# #502444. -invoke-rc.d ssh restart >/dev/null 2>&1 || true +# We'd like to use 'reload' here, but it has some problems; see #502444. On +# the other hand, repeated restarts of ssh make systemd unhappy +# (#756547/#757822), so use reload in that case. +if [ -d /run/systemd/system ]; then + action=reload +else + action=restart +fi +invoke-rc.d ssh $action >/dev/null 2>&1 || true exit 0 -- cgit v1.2.3