config, cli, packaging, nix: stop restarting headscale on a configuration error

serve exits 78 (EX_CONFIG) when the configuration file it loaded is
wrong: format, syntax, keys or values. No file, an unreadable one, the
database and ports still exit 1, so systemd keeps retrying what can
heal. The deb unit and the NixOS module set RestartPreventExitStatus=78.
A parse error gives a position and fixed words, never the file's text.

Updates #1926
This commit is contained in:
Kristoffer Dalby committed 2026-11-11 12:19:29 +01:00
1 parent 73ef19c0ab
commit eff078ffa2
10 files changed
+205 -7

No files matched your search

+3
View File
@@ -10,6 +10,9 @@ ExecStart=/usr/bin/headscale serve
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always
RestartSec=5
# headscale serve exits 78 (EX_CONFIG) on a configuration it rejects, which
# a restart cannot fix.
RestartPreventExitStatus=78
WorkingDirectory=/var/lib/headscale
ReadWritePaths=/var/lib/headscale