gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.93k stars 283 forks source link

Add optional systemd integration #396

Closed hg closed 2 years ago

hg commented 2 years ago

re #338

Static analysis job will fail until this is rebased on top of #395.


The code is using libsystemd because the library is going to be present on any systemd-based distribution anyway. Otherwise, we're going have to handle things like:

If the $WATCHDOG_USEC environment variable is set, and the $WATCHDOG_PID variable is unset or set to the PID of the current process, the service manager expects notifications from this process.

If the usec parameter is non-NULL, sd_watchdog_enabled() will write the timeout in µs for the watchdog logic to it.

(which really means parsing data passed by systemd in environment variables)

If the first character of $NOTIFY_SOCKET is "@", the string is understood as Linux abstract namespace socket.

and so on.


There's also the RELOADING event, but I see no point in adding it since configuration reloading is nearly instantaneous.