Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call systemd's sd_notify when doing --create-netns-only #255

Open
musjj opened this issue Mar 12, 2024 · 2 comments
Open

Call systemd's sd_notify when doing --create-netns-only #255

musjj opened this issue Mar 12, 2024 · 2 comments

Comments

@musjj
Copy link

musjj commented Mar 12, 2024

I'm running vopono as a root service, which works pretty well (despite this issue: #84?). But it would be nicer if the service can be notified when the namespace is actually created, to avoid race conditions.

Daemons can do this by calling sd_notify. Services with Type=notify will then respond accordingly:

https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Type=

Behavior of notify is similar to exec; however, it is expected that the service sends a "READY=1" notification message via sd_notify(3) or an equivalent call when it has finished starting up. systemd will proceed with starting follow-up units after this notification message has been sent.

@jamesmcm
Copy link
Owner

You might be able to do this already with a --postup script btw, but I'll take a look and try it out, thanks!

@musjj
Copy link
Author

musjj commented Mar 13, 2024

Thanks, passing a systemd-notify --ready script to --postup works pretty well for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants