From: Ian Jackson Subject: [OSSTEST PATCH 1/7] Debian installs: Nobble /etc/network/if-up.d/openssh-server Date: Tue, 29 Sep 2015 14:37:21 +0100 Message-ID: <1443533847-16987-2-git-send-email-ian.jackson@eu.citrix.com> References: <1443533847-16987-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zgv6F-0002r1-8u for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 13:37:43 +0000 In-Reply-To: <1443533847-16987-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org (See the comment in the new file for the explanation.) This change affects all our Debian installs (both hosts and guests) which are done with preseeding, because preseed_base() arranges to install overlay/. Signed-off-by: Ian Jackson --- overlay/etc/network/if-up.d/openssh-server | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 overlay/etc/network/if-up.d/openssh-server diff --git a/overlay/etc/network/if-up.d/openssh-server b/overlay/etc/network/if-up.d/openssh-server new file mode 100755 index 0000000..9fe2faf --- /dev/null +++ b/overlay/etc/network/if-up.d/openssh-server @@ -0,0 +1,32 @@ +#!/bin/sh +exit 0 + +# In a default Debian install, this script reloads (or, in some +# versions of Debian, restarts) sshd as new network interfaces come +# up. This is in case you have specific listen addresses specified in +# the config. +# +# But the default config listens on 0.0.0.0 and ::. So sshd is active +# as soon as an interface is up, and does not need to be restarted or +# reloaded. +# +# This restarting or reloading is harmful because it causes ssh to +# stop listening briefly. We can see the following race: +# +# target sshd target dhcp client osstest controller +# +# starts starts +# binds to ANY obtains lease +# configures eth0 +# connects to :22 with nc +# accepts conn nc succeeds +# decides target sshd is up +# runs ifup hook +# ifup hook reloads +# +# gets SIGHUP +# closes listen socket +# rereads config runs ssh root@target +# ssh gets ECONNREFUSED +# opens new listen socket +# declares test fail -- 1.7.10.4