mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-20 04:14:32 +09:00
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:
1 parent
73ef19c0ab
commit
eff078ffa2
10 files changed
+205
-7
No files matched your search
@@ -53,7 +53,7 @@ case "$1" in
|
||||
else
|
||||
if [ -n "$2" ]; then
|
||||
echo 'headscale was not restarted after the upgrade: its configuration does not pass "headscale check config" (errors above).' >&2
|
||||
echo 'A running headscale keeps the previous version only until it restarts: needrestart after apt, a reboot or a crash starts this version, which refuses the configuration.' >&2
|
||||
echo 'A running headscale keeps the previous version only until it restarts: needrestart after apt, a reboot or a crash starts this version, which refuses the configuration and stays stopped until it is fixed.' >&2
|
||||
else
|
||||
echo 'headscale was not started: its configuration does not pass "headscale check config" (errors above).' >&2
|
||||
fi
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user