You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ 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.
Here's the problem:
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 forType=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 writeREADY=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.
The text was updated successfully, but these errors were encountered: