public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta-test: Disable sshd socket activation for CI purpose
@ 2023-07-05  4:48 Uladzimir Bely
  2023-07-05  9:13 ` Bezdeka, Florian
  2023-07-11  6:40 ` Uladzimir Bely
  0 siblings, 2 replies; 4+ messages in thread
From: Uladzimir Bely @ 2023-07-05  4:48 UTC (permalink / raw)
  To: isar-users

Openssh-server package in Debian comes with socket activation enabled.
This means that every command executed over ssh by CI scripts starts
new sshd instance on target.

Sometimes, this makes CI fail: another SSH "ping" or command may fail
even if all the previous "pings" were OK.

SSH "ping" with debug, when qemu machine is starting:

```
while true; do
  ssh -o ConnectTimeout=5 -p 47457 <options> ci@localhost /bin/true;
  echo $?;
  sleep 1;
done
```

Output:

```
Connection timed out during banner exchange
Connection to 127.0.0.1 port 47457 timed out
255
Connection timed out during banner exchange
Connection to 127.0.0.1 port 47457 timed out
255
0
0
0
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 47457
255
0
0
0
```

Disabling socket activation by setting corresponding system-preset
fixes the issue.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 .../isar-ci-ssh-setup/files/99-disable-ssh-socket.preset      | 4 ++++
 .../recipes-ci/isar-ci-ssh-setup/isar-ci-ssh-setup_0.1.bb     | 4 ++++
 2 files changed, 8 insertions(+)
 create mode 100644 meta-test/recipes-ci/isar-ci-ssh-setup/files/99-disable-ssh-socket.preset

diff --git a/meta-test/recipes-ci/isar-ci-ssh-setup/files/99-disable-ssh-socket.preset b/meta-test/recipes-ci/isar-ci-ssh-setup/files/99-disable-ssh-socket.preset
new file mode 100644
index 00000000..aced69e1
--- /dev/null
+++ b/meta-test/recipes-ci/isar-ci-ssh-setup/files/99-disable-ssh-socket.preset
@@ -0,0 +1,4 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+disable ssh.socket
diff --git a/meta-test/recipes-ci/isar-ci-ssh-setup/isar-ci-ssh-setup_0.1.bb b/meta-test/recipes-ci/isar-ci-ssh-setup/isar-ci-ssh-setup_0.1.bb
index 74fecf92..4693f647 100644
--- a/meta-test/recipes-ci/isar-ci-ssh-setup/isar-ci-ssh-setup_0.1.bb
+++ b/meta-test/recipes-ci/isar-ci-ssh-setup/isar-ci-ssh-setup_0.1.bb
@@ -5,6 +5,7 @@ MAINTAINER = "Uladzimir Bely <uladzimir.bely@ilbers.de>"
 
 SRC_URI = " \
     file://postinst \
+    file://99-disable-ssh-socket.preset \
 "
 
 DEPENDS += "sshd-regen-keys"
@@ -19,4 +20,7 @@ do_install() {
 
     # Manage all interfaces (including ethernet) by NetworkManager
     install -D -m 644 /dev/null ${D}/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
+
+    # Disable socket activation for ssh server
+    install -D -m 644 ${WORKDIR}/99-disable-ssh-socket.preset ${D}/lib/systemd/system-preset/99-disable-ssh-socket.preset
 }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-11  6:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05  4:48 [PATCH] meta-test: Disable sshd socket activation for CI purpose Uladzimir Bely
2023-07-05  9:13 ` Bezdeka, Florian
2023-07-06  4:13   ` Uladzimir Bely
2023-07-11  6:40 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox