Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 1/2] readyfd2sd: add recipe
@ 2026-07-15 10:13 Lucas Stach
  2026-07-15 10:13 ` [PATCH v2 2/2] seatd: use readyfd2sd to get rid of systemd service startup races Lucas Stach
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2026-07-15 10:13 UTC (permalink / raw)
  To: openembedded-core; +Cc: yocto

Some services, such as seatd, only implement the s6 init ready notifications.
readyfd2sd translates those notifications to the systemd-notify format to
make them usable with the systemd init system.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
v2:
- add maintainers entry
- add check for systemd distro feature
---
 meta/conf/distro/include/maintainers.inc       |  1 +
 meta/recipes-core/readyfd2sd/readyfd2sd_git.bb | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 meta/recipes-core/readyfd2sd/readyfd2sd_git.bb

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 07e840ac34dc..bf1c15db6596 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -768,6 +768,7 @@ RECIPE_MAINTAINER:pn-quilt-native = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER:pn-quota = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-re2c = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-readline = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER:pn-readyfd2sd = "Lucas Stach <yocto@pengutronix.de>"
 RECIPE_MAINTAINER:pn-repo = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-resolvconf = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-rgb = "Unassigned <unassigned@yoctoproject.org>"
diff --git a/meta/recipes-core/readyfd2sd/readyfd2sd_git.bb b/meta/recipes-core/readyfd2sd/readyfd2sd_git.bb
new file mode 100644
index 000000000000..4f16a0ee65e3
--- /dev/null
+++ b/meta/recipes-core/readyfd2sd/readyfd2sd_git.bb
@@ -0,0 +1,15 @@
+SUMMARY = "s6 readyfd to systemd sd_notify adapter"
+DESCRIPTION = "${SUMMARY}"
+HOMEPAGE = "https://git.sr.ht/~kennylevinsen/readyfd2sd"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c50481d620cb912754d78d319eeec30a"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+DEPENDS = "systemd"
+
+PV = "0.1+git"
+SRC_URI = "git://git.sr.ht/~kennylevinsen/readyfd2sd;protocol=https;branch=master"
+SRCREV = "87c99ce10dca3f3c3e5c3a0d994ee7892e952b61"
+
+inherit meson pkgconfig systemd features_check
-- 
2.47.3



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

* [PATCH v2 2/2] seatd: use readyfd2sd to get rid of systemd service startup races
  2026-07-15 10:13 [PATCH v2 1/2] readyfd2sd: add recipe Lucas Stach
@ 2026-07-15 10:13 ` Lucas Stach
  2026-07-18 17:19   ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2026-07-15 10:13 UTC (permalink / raw)
  To: openembedded-core; +Cc: yocto

Currently systemd has no insight into the startup state of the seatd server
process, so it might start dependant services too early, causing them to
fail due to being unable to connect to seatd.

Use the readyfd2sd adapter to convert the seatd s6 ready notification to
systemd-notify and switch the service to the notify type to allow systemd
to defer dependant service startup until seatd is ready to accept requests.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 ...yfd2sd-to-notify-systemd-about-servi.patch | 34 +++++++++++++++++++
 meta/recipes-core/seatd/seatd_0.9.3.bb        |  3 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/seatd/seatd/0001-systemd-use-readyfd2sd-to-notify-systemd-about-servi.patch

diff --git a/meta/recipes-core/seatd/seatd/0001-systemd-use-readyfd2sd-to-notify-systemd-about-servi.patch b/meta/recipes-core/seatd/seatd/0001-systemd-use-readyfd2sd-to-notify-systemd-about-servi.patch
new file mode 100644
index 000000000000..59b880bb6f13
--- /dev/null
+++ b/meta/recipes-core/seatd/seatd/0001-systemd-use-readyfd2sd-to-notify-systemd-about-servi.patch
@@ -0,0 +1,34 @@
+From b4aa488bd43577ebbf4df5eb1272c724b32bffa9 Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Fri, 7 Nov 2025 21:37:01 +0100
+Subject: [PATCH] systemd: use readyfd2sd to notify systemd about service
+ startup
+
+Currently the example systemd service is racy, as systemd has no insight
+into the startup state of the seatd process. Use the readyfd2sd adapter
+in the service file to let systemd know when seatd is operational.
+
+Upstream-Status: Submitted [https://lists.sr.ht/~kennylevinsen/seatd-devel/patches/70377]
+---
+ contrib/systemd/seatd.service | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/systemd/seatd.service b/contrib/systemd/seatd.service
+index 0460e9e20644..d0b45933b463 100644
+--- a/contrib/systemd/seatd.service
++++ b/contrib/systemd/seatd.service
+@@ -3,9 +3,9 @@ Description=Seat management daemon
+ Documentation=man:seatd(1)
+ 
+ [Service]
+-Type=simple
++Type=notify
+ # Specify the group you'd like to grant access to seatd
+-ExecStart=seatd -g seat
++ExecStart=readyfd2sd -- seatd -g seat -n %%n
+ Restart=always
+ RestartSec=1
+ 
+-- 
+2.47.3
+
diff --git a/meta/recipes-core/seatd/seatd_0.9.3.bb b/meta/recipes-core/seatd/seatd_0.9.3.bb
index d0802eee6041..304f72ab0846 100644
--- a/meta/recipes-core/seatd/seatd_0.9.3.bb
+++ b/meta/recipes-core/seatd/seatd_0.9.3.bb
@@ -7,6 +7,7 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=715a99d2dd552e6188e74d4ed2914d5a"
 
 SRC_URI = "git://git.sr.ht/~kennylevinsen/seatd;protocol=https;branch=master \
+           file://0001-systemd-use-readyfd2sd-to-notify-systemd-about-servi.patch \
            file://init"
 SRCREV = "daa8196e10b180b8b0caeafa8e5f860eb1bd6706"
 
@@ -29,7 +30,7 @@ PACKAGECONFIG ?= " \
 "
 
 PACKAGECONFIG[libseat-builtin] = "-Dlibseat-builtin=enabled,-Dlibseat-builtin=disabled"
-PACKAGECONFIG[systemd] = "-Dlibseat-logind=systemd,,systemd"
+PACKAGECONFIG[systemd] = "-Dlibseat-logind=systemd,,systemd,readyfd2sd"
 
 do_install:append() {
         if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
-- 
2.47.3



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

* Re: [OE-core] [PATCH v2 2/2] seatd: use readyfd2sd to get rid of systemd service startup races
  2026-07-15 10:13 ` [PATCH v2 2/2] seatd: use readyfd2sd to get rid of systemd service startup races Lucas Stach
@ 2026-07-18 17:19   ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2026-07-18 17:19 UTC (permalink / raw)
  To: Lucas Stach, openembedded-core; +Cc: yocto

On Wed Jul 15, 2026 at 12:13 PM CEST, Lucas Stach wrote:
> Currently systemd has no insight into the startup state of the seatd server
> process, so it might start dependant services too early, causing them to
> fail due to being unable to connect to seatd.
>
> Use the readyfd2sd adapter to convert the seatd s6 ready notification to
> systemd-notify and switch the service to the notify type to allow systemd
> to defer dependant service startup until seatd is ready to accept requests.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---

Hi,

Thanks for the new version.

It looks like the systemd.SystemdBasicTests.test_systemd_failed test is
failing with this patch, strangely, only for images built without x11
support:

Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/no-x11/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
  File "/srv/pokybuild/yocto-worker/no-x11/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/systemd.py", line 95, in test_systemd_failed
    self.assertTrue(settled, msg=msg)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
AssertionError: False is not true : Timed out waiting for systemd to settle:
starting
...
RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (127.02s)
SUMMARY:
core-image-weston () - Ran 76 tests in 206.326s
core-image-weston - FAIL - Required tests failed (successes=42, skipped=33, failures=1, errors=0)
core-image-weston - FAILED - Last lines of QEMU boot logs:
--- qemu_boot_log.20260718112858 ---
[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49632)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49648)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49658)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49668)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49684)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49692)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49706)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49708)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49724)␛[0m.

[␛[0;32m  OK  ␛[0m] Started ␛[0;1;39mSSH Per-Connection Server (192.168.7.3:49728)␛[0m.


--- qemu_boot_log.20260718112858.2 ---
␛[!p␛]104␛\␛[0m␛[?7h␛[1G␛[0J␛[6n
␛[6n␛[!p␛]104␛\␛[0m␛[?7h␛[1G␛[0J␛[6n
␛[6n␛]3008;start=403e36bd5a1c42bbb36601d3a29037c0;user=root;hostname=qemux86-64;machineid=8e279edcef204437b2cc30688f5a9895;bootid=7994f691f1d5422db4ac58bdaddd68dd;pid=246;pidfdid=247;comm=(agetty);servicename=serial-getty@ttyS1.service;invocationid=cefe0df5c3e34907826aff9044103155;type=service␛\␛P+q6E616D65␛\

https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/4157

If needed, the build configuration is here:
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/7747007/raw_inline

Can you have a look at the issue?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



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

end of thread, other threads:[~2026-07-18 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 10:13 [PATCH v2 1/2] readyfd2sd: add recipe Lucas Stach
2026-07-15 10:13 ` [PATCH v2 2/2] seatd: use readyfd2sd to get rid of systemd service startup races Lucas Stach
2026-07-18 17:19   ` [OE-core] " Mathieu Dubois-Briand

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