tailscale / tailscale/tailscale
FR: Add way to "reload" tailscaled
- Dominant language
- Go
- Stars
- 36.5k
- Forks
- 3.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 123
Description
### What are you trying to do?
We have some Linux devices that use firewalld (which configures nftables).
When there are firewalld changes that cause existing nftables rules to be flushed, firewalld sends a `Reloaded()` signal to systemd via dbus
With systemd, it's possible to add `ReloadPropagatedFrom=firewalld.service` to the `[Unit]` section of tailscaled.service in order for tailscaled to receive a reload.
If we could either use `ExecReload=tailscaled --reload` or `ExecReload=kill -HUP $MAINPID` to tell tailscaled to redo nftables (or iptables) rules, that would be a great help. (It would be reasonable for it to close and re-open files, etc). Changing to `Restart=always` and using the `kill -HUP` solution does work, but it fully restarts tailscaled instead of a more graceful reload.
### How should we solve this?
Either of:
- when receiving SIGHUP signal, instead of tailscaled exiting, it could flush and re-add nftables/iptables rules.
- Add an option to tailscaled or tailscale to tell the tailscaled daemon to re-add nftables/iptables rules.
### What is the impact of not solving this?
Getting tailscale working on a system with firewalld basically requires:
```ini
[Unit]
After=firewalld.service
BindsTo=firewalld.service
Requires=firewalld.service
ReloadPropagatedFrom=firewalld.service
[Service]
ExecStopPost=tailscaled --cleanup
ExecReload=kill -HUP $MAINPID
Restart=always
```
And that means that firewall changes are fully restarting the tailscaled service instead of something more graceful.
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.