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

lsahn at wewakecorp.com lsahn at wewakecorp.com
Tue Jun 11 09:25:44 UTC 2024


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..
The container has been built by systemd-nspawn and it runs systemd as init
program.

--- Host's service file ---
[Unit]
Description=Leesoo's mydaemon
Requires=leesoo at slices.target  <-- Maybe like this..? it doesn't work by the
way.
After=leesoo at slices.target      <-- same as above

[Service]
ExecStart=/usr/bin/system-run -M leesoo /root/mydaemon
Type=forking
Restart=on-failure
RestartSec=5s
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
--------

Best regards,
Leesoo



More information about the systemd-devel mailing list