tralph3 / ZeroTier-GUI

A Linux front-end for ZeroTier
GNU General Public License v3.0
211 stars 32 forks source link

systemd hard dependency #23

Open duarm opened 1 year ago

duarm commented 1 year ago

Thanks for making zerotier-gui! This hard depends on systemd because it uses systemctl to check if zerotier is running. what about running zerotier-cli instead?

Not running

$ zerotier-cli listnetworks
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.

Running

$ zerotier-cli listnetworks
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks xxxxxxxxxxxxx xxxxxx xx:xx:xx:xx:xx:xx OK PRIVATE xxxxxxxxxx xxxx:xxxx:xx:xxxx:xxxx::x/xx,xxx.xxx.xxx.xxx/xx

Maybe checking listened ports with netstat? detecting interface with ip addr? Abstract the check for multiple init systems?

tralph3 commented 1 year ago

Hi. I'm in the middle of a rewrite that addresses this problem. It still would need SystemD to handle the ZeroTier service tho.

duarm commented 1 year ago

Thanks, as long as it works with other init systems, no problem

tralph3 commented 1 year ago

I don't have much experience with other init systems, but I wouldn't mind supporting them if it's not a hard task. Does ZeroTier work out of the box with other init systems? Or do you need to write the service file yourself?

duarm commented 1 year ago

Works out of the box, non systemd distros just ship the equivalent service files for their init system, gentoo for example uses openrc, and they provide the openrc service file with the zerotier package https://gitweb.gentoo.org/repo/gentoo.git/plain/net-misc/zerotier/files/zerotier.init-r1