Skip to content

Commit

Permalink
Merge pull request #254934 from NetaliDev/headscale-sigterm-fix
Browse files Browse the repository at this point in the history
headscale: fix reacting to SIGTERM
  • Loading branch information
K900 authored Aug 22, 2024
2 parents 3a6a229 + 37947d5 commit 6c31eb9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/servers/headscale/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"];
Expand Down
12 changes: 12 additions & 0 deletions pkgs/servers/headscale/sigterm-fix.patch
Original file line number Diff line number Diff line change
@@ -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
}
}
}

0 comments on commit 6c31eb9

Please sign in to comment.