headscale: fix reacting to SIGTERM

The current version of headscale does not react to SIGTERMs and so it
can only be terminated by a SIGKILL at the moment. This commit provides
a patch to fix this.
This commit is contained in:
Jennifer Graul 2023-09-13 13:32:47 +02:00 committed by K900
parent ae84fdb5e1
commit 37947d59ea
2 changed files with 16 additions and 0 deletions

View File

@ -21,6 +21,10 @@ buildGoModule rec {
patches = [
# backport of https://github.com/juanfont/headscale/pull/1697
./trim-oidc-secret-path.patch
# fix for headscale not reacting to SIGTERM
# see https://github.com/juanfont/headscale/pull/1480 and https://github.com/juanfont/headscale/issues/1461
./sigterm-fix.patch
];
ldflags = ["-s" "-w" "-X github.com/juanfont/headscale/cmd/headscale/cli.Version=v${version}"];

View File

@ -0,0 +1,12 @@
diff --git a/hscontrol/app.go b/hscontrol/app.go
index b8dceba..4bcf019 100644
--- a/hscontrol/app.go
+++ b/hscontrol/app.go
@@ -821,6 +821,7 @@ func (h *Headscale) Serve() error {
// And we're done:
cancel()
+ return
}
}
}