]> xenbits.xensource.com Git - osstest.git/commitdiff
Debian installs: Nobble /etc/network/if-up.d/openssh-server
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 28 Sep 2015 15:19:31 +0000 (16:19 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 29 Sep 2015 15:36:07 +0000 (16:36 +0100)
(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 <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
overlay/etc/network/if-up.d/openssh-server [new file with mode: 0755]

diff --git a/overlay/etc/network/if-up.d/openssh-server b/overlay/etc/network/if-up.d/openssh-server
new file mode 100755 (executable)
index 0000000..9fe2faf
--- /dev/null
@@ -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