Re: sdnotify-wrapper but the other way around

Jan Braun <[email protected]> Sun, 2 Mar 2025 12:10:09 +0100
Newsgroups gmane.comp.sysutils.supervision.general
Message-ID <Z8Q8kWqePuGArJiL@abakus>
Hey,
[email protected] schrob:
> Here's sdnotify-wrapper[1] but inverted: it pretends to be systemd's
> side of the sd-notify protocol, listens for an sd-style "READY=1", and
> then notifies s6 on behalf of the ready service.

The cleverness of s6's readiness protocol is that it will recognize
systemd's "READY=1\n" output as an instance of its own "arbitrary bytes,
then a newline" readiness notification. So your wrapper should usually
not be necessary.
There could be programs using sd_notify to signal other things besides
readiness (notifying a "WATCHDOG=1" seems to exist), in which case such
a wrapper may indeed be needed for correct operation.
But grepping tailsacale's source indicates that they only sdnotify
readiness, thus you should get working and correct readiness status by
just setting up the notification-fd.

> I've attached a rough implementation of this idea, [...]

No attachment arrived here.

Cheers,
    Jan
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFzbVDxcLcKaSI7wVKV5wPm0dL88FAmfEPIsACgkQKV5wPm0d
L8+hfw/+JoSXxkFIlvZuFCH8RZhe5GfxTmz+FvRs0XNLOs5K+gsF4Ym05h897P8k
uSU552S2yoKUcw0KuYtjCZ2nZ3tXB5f9u/BnC9Vrwe1XcGTuk24568udGqmo5Mav
xvF71xpX98WdbqutU0usYlvMuwFKNkTDq7uIbDvqJAU1FKr1GNGZ6dB6LaLZCjco
IlABsJnoisvSm9begaCQNgukpqC17kQssyo0oWoqvh2R++9fvHtw2wDbBWmByNam
JJpYVUENHVbXcMVfd4wqZZGiHpkQ+Bp3tqdYAH0kdMeWtflQMYX/2+3zeCDThf3i
k6SPkKfi3RxqxWTqUMG76W+3Gik3IUW9qB9Hf3BC0s7zE6i6T6ydQtSdDus9FFiE
GqspLRPFII2eXxXVYI7Dfhis+wfty8R6kkUPhRtlFFjjAZGgzMoXGHMRaqz4+BY8
pi2ZFZ+zzRN8URlp7P+SzzpA+CZo73aP3ZT8iUaMhwkpMLZONeDI0wv856Tqlh4b
v2Pxr8cZgD+0NFJQhKanuNsbFm/S19mLy/4uCBO5zifBWFx51RtsT745wmc4Bq9S
cgiTlIa6mbr+fTPOSjM/r+f3XF4FJdRznJ0nn8GSS3wic7Y9qNB9+IS9Z3C7VTuL
6L1CSG7MnIzheTkYcxSkaSQQZ2e4WvHcICQsA7WwbpdKzxZbBg0=
=yFeI
-----END PGP SIGNATURE-----