[systemd-devel] Use container's service as dependencies in Host's systemd service unit

Lennart Poettering lennart at poettering.net
Tue Jun 11 13:07:28 UTC 2024


On Di, 11.06.24 18:25, lsahn at wewakecorp.com (lsahn at wewakecorp.com) wrote:

> Hello, thank you all developers for your efforts first.
>
> I just wonder whether I can use container's services as dependencies in
> Host's system service unit or not..

No that is not directly supported.

But do note that systemd when run in a container will send out READY=1
sd_notify() messages when it finished startup, and systemd-nspawn may
wait for that and forward it to its own supervisor if you pass
--notify-ready=yes to it.

In other words: if you run systemd inside a container, and define
various services inside the container, then you can properly
synchronize on them collectively to finish start-up by waiting for
systemd-nspawn at .service to start up. (if you add --notify=ready=yes
that is).

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list