[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#832557: marked as done (systemctl restart networking hangs reloading ssh.service)

Your message dated Fri, 29 Jul 2016 04:19:35 +0000
with message-id <E1bSzGp-0002zr-Pp@franck.debian.org>
and subject line Bug#832557: fixed in openssh 1:7.2p2-8
has caused the Debian Bug report #832557,
regarding systemctl restart networking hangs reloading ssh.service
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

832557: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832557
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: openssh-server
Version: 1:7.2p2-7
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch yakkety


In https://launchpad.net/bugs/1584393 it was reported that "systemctl
restart networking" sometimes gets into a deadlock:

   CGroup: /system.slice/networking.service
           ├─1383 /sbin/ifup -a --read-environment
           ├─1479 /sbin/dhclient -1 -v -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6
           ├─1480 /bin/sh -c /bin/run-parts --exit-on-error /etc/network/if-up.d
           ├─1481 /bin/run-parts --exit-on-error /etc/network/if-up.d
           ├─1504 /bin/sh /etc/network/if-up.d/openssh-server
           ├─1507 /bin/sh /usr/sbin/invoke-rc.d ssh reload
           └─1527 systemctl reload ssh.service

This then waits for each other and only times out after 90s. I cannot
reproduce the hang myself, so I'm not sure why sshd takes so long to
respond. But it was reported that not blocking on reload to finish
fixes this, i. e. ifup -a then finishes quickly, consequently the
"restart networking" does as well, and sshd can then go on.

This is done in the attached patch. Even though I cannot fully explain
what's going on, it cannot hurt to be asynchronous in the if-up.d

Thanks for considering,


P.S. Any chance that sshd could start using IP_FREEBIND and avoid the
if-up.d hack altogether?

Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 14d29a2a7f499245a9e14b217140328c90e07558 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 26 Jul 2016 22:11:09 +0200
Subject: [PATCH] debian/openssh-server.if-up: Don't block on a finished reload
 of openssh.service

This avoids deadlocking with restarting networking.

LP: #1584393
 debian/changelog            | 3 +++
 debian/openssh-server.if-up | 5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dd6f7dc..a84a581 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ openssh (1:7.2p2-8) UNRELEASED; urgency=medium
     agent in the user session. Use it in ssh-agent.user-session.upstart.
   * Add systemd user unit for graphical sessions that use systemd. Override
     the corresponding upstart job in that case.
+  * debian/openssh-server.if-up: Don't block on a finished reload of
+    openssh.service, to avoid deadlocking with restarting networking.
+    (LP: #1584393)
  -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 25 Jul 2016 17:01:56 +0200
diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up
index dd05ea5..915284c 100644
--- a/debian/openssh-server.if-up
+++ b/debian/openssh-server.if-up
@@ -34,10 +34,9 @@ fi
 # 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
+	systemctl reload --no-block ssh.service >/dev/null 2>&1 || true
-	action=restart
+	invoke-rc.d ssh restart >/dev/null 2>&1 || true
-invoke-rc.d ssh $action >/dev/null 2>&1 || true
 exit 0

Attachment: signature.asc
Description: PGP signature

--- End Message ---
--- Begin Message ---
Source: openssh
Source-Version: 1:7.2p2-8

We believe that the bug you reported is fixed in the latest version of
openssh, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 832557@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Colin Watson <cjwatson@debian.org> (supplier of updated openssh package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)

Hash: SHA256

Format: 1.8
Date: Fri, 29 Jul 2016 02:51:32 +0100
Source: openssh
Binary: openssh-client openssh-client-ssh1 openssh-server openssh-sftp-server ssh ssh-krb5 ssh-askpass-gnome openssh-client-udeb openssh-server-udeb
Architecture: source
Version: 1:7.2p2-8
Distribution: unstable
Urgency: medium
Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
 openssh-client - secure shell (SSH) client, for secure access to remote machines
 openssh-client-ssh1 - secure shell (SSH) client for legacy SSH1 protocol
 openssh-client-udeb - secure shell client for the Debian installer (udeb)
 openssh-server - secure shell (SSH) server, for secure access from remote machines
 openssh-server-udeb - secure shell server for the Debian installer (udeb)
 openssh-sftp-server - secure shell (SSH) sftp server module, for SFTP access from remot
 ssh        - secure shell client and server (metapackage)
 ssh-askpass-gnome - interactive X program to prompt users for a passphrase for ssh-ad
 ssh-krb5   - secure shell client and server (transitional package)
Closes: 832155 832445 832557
 openssh (1:7.2p2-8) unstable; urgency=medium
   [ Colin Watson ]
   * Stop enabling ssh-session-cleanup.service by default; instead, ship it
     as an example and add a section to README.Debian.  libpam-systemd >= 230
     and "UsePAM yes" should take care of the original problem for most
     systemd users (thanks, Michael Biebl; closes: #832155).
   [ Martin Pitt ]
   * Add debian/agent-launch: Helper script for conditionally starting the SSH
     agent in the user session. Use it in ssh-agent.user-session.upstart.
   * Add systemd user unit for graphical sessions that use systemd. Override
     the corresponding upstart job in that case (closes: #832445).
   * debian/openssh-server.if-up: Don't block on a finished reload of
     openssh.service, to avoid deadlocking with restarting networking.
     (closes: #832557, LP: #1584393)
 20205f98e98ebf139f83cb2ea54d99879511387e 2884 openssh_7.2p2-8.dsc
 ed0db2274a92c43e7838792a78c9410e1830412e 155012 openssh_7.2p2-8.debian.tar.xz
 e778efe40936b501934e610e111366778127fc1517abf50533a0c16618a6c700 2884 openssh_7.2p2-8.dsc
 12a769972a4dfb379203c966d8bc2b848246ee69c83abffa2875b91adafb1525 155012 openssh_7.2p2-8.debian.tar.xz
 7e3e0ca8818b3f61b5775b903fab9530 2884 net standard openssh_7.2p2-8.dsc
 74cef7c835704e93c61eb234c59cc7d2 155012 net standard openssh_7.2p2-8.debian.tar.xz

Version: GnuPG v1
Comment: Colin Watson <cjwatson@debian.org> -- Debian developer


--- End Message ---

Reply to: