neocturne / fastd

Fast and Secure Tunnelling Daemon
Other
119 stars 16 forks source link

OpenRC service management script #27

Open faithanalog opened 1 year ago

faithanalog commented 1 year ago

Hey there, I'm working on packaging this for gentoo right now, and in the process I'm writing openrc and systemd services. Would you be interested in me upstreaming them here? I'm happy to work with you if you have any qualms with the way I implement them too.

neocturne commented 1 year ago

Hi, for systemd there is already a unit that is used by many distros that package fastd: https://github.com/NeoRaider/fastd/blob/main/doc/examples/fastd%40.service

I'm not familiar with openrc - how specific would this be to Gentoo? If it is only useful for Gentoo, I'd rather not have it in the fastd repo. While there is an OpenWrt init script in this repo, I think adding it here was a mistake, as it is not compatible with all OpenWrt releases, and the OpenWrt package repo would actually be a more appropriate place...

faithanalog commented 1 year ago

oh, I didn't think to check the examples for a service, thanks for that!

the most prominent use of OpenRC outside gentoo is probably Alpine Linux, where it is the default init system. Though you could use it on anything without too much effort, including the BSDs. but Alpine and Gentoo are the big ones where it's out of the box what someone would be using.

faithanalog commented 1 year ago

https://github.com/gentoo/guru/blob/master/net-vpn/fastd/files/fastd.init here's the openrc service file I ended up with for OpenRC btw, now that I've gotten it into guru (gentoo users' repo). This gets installed at /etc/init.d/fastd, and then a user (that is to say, me) symlinks it to /etc/init.d/fastd.whatever_vpn and runs rc-update add fastd.whatever_vpn default. The symlink + rc-update is analogous to systemctl enable fastd@whatever_vpn.service, and matches how the wg-quick openrc service works.