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

zerotier-one should support systemd notification #2277

Open
haileys opened this issue Apr 27, 2024 · 1 comment
Open

zerotier-one should support systemd notification #2277

haileys opened this issue Apr 27, 2024 · 1 comment
Labels
Good First Issue SEO for Github Search Linux Linux-related issue Type: Enhancement

Comments

@haileys
Copy link

haileys commented Apr 27, 2024

Here's the problem:

$ sudo systemctl start zerotier-one && sudo zerotier-cli info
Error connecting to the ZeroTier service: connection failed

Please check that the service is running and that TCP port 9993 can be contacted via 127.0.0.1.

systemctl start will wait until a service is ready before returning - which is essential to avoid race conditions when installing and configuring zerotier from a script. However this only works for Type=notify services. Otherwise a small sleep is required, which is needlessly pessimistic when the zerotier-one service is already running.

ZeroTier One should support systemd notification so that it can notify systemd when it has bound to its control interface and is ready to accept commands.

Implementing notification is simple: if the NOTIFY_SOCKET env var is set, open a datagram socket and write READY=1 once the service has finished booting.

I've had a quick look at the code, and I think here would be the right place to insert the ready notification.

@laduke laduke added Linux Linux-related issue Type: Enhancement Good First Issue SEO for Github Search labels Apr 29, 2024
@laduke
Copy link
Contributor

laduke commented Apr 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue SEO for Github Search Linux Linux-related issue Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants