Repository navigation
Signal server ignores SIGTERM and skips its shutdown on docker stop #8198
Unanswered
chad-loder
asked this question in
Issue Triage
Replies: 1 comment
|
Confirmed on current Until the one-line fix lands (
That's the same thing |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before posting
Affected area
Relay / Signal / NAT traversal, Self-hosting / Deployment
Deployment type
Self-hosted - advanced/custom deployment
Operating system or environment
Linux, Docker
NetBird version and upgrade status
signal/cmd/root.go,SetupCloseHandler).Did this work before?
Not sure
Regression details
No response
Summary
The signal server's shutdown handler registers only
os.Interrupt(SIGINT):signal.Notify(c, os.Interrupt)insignal/cmd/root.go, under a comment that says it handles SIGTERM. SIGTERM, whichdocker stop, systemd and Kubernetes send by default, is not caught, so the process is terminated without running its shutdown path. Management, relay, the combined server and the client all registersyscall.SIGTERM; signal is the only one that does not.Current behavior
On SIGTERM the signal process ends at once. The shutdown in
run.go(closing the gRPC, HTTP and certificate listeners, shutting down the metrics server, loggingstopped Signal Service) does not run.signal/Dockerfile.ubicompensates withSTOPSIGNAL SIGINT;signal/Dockerfiledoes not, sodocker stopon the standard image sends SIGTERM.Expected behavior
SIGTERM triggers the same shutdown as SIGINT, as in the other services, and the comment matches the code.
Steps to reproduce
netbird-signal run ...).kill -TERM <pid>, ordocker stopon a container fromsignal/Dockerfile).stopped ...log lines that SIGINT produces.Environment and topology
Signal in its own container. The behavior does not depend on topology.
Self-hosted details, if available
No response
Logs, status output, or debug evidence
With SIGINT the log ends with
stopped HTTP server,stopped metrics server,stopped Signal Service; with SIGTERM none of these appear.Related issues or discussions
None found.
Possible change
Add
syscall.SIGTERMto thesignal.Notifycall inSetupCloseHandlerand correct its comment (and theCtrl+C pressedmessage), matching relay's and management's handlers. The impact today is small, since peers reconnect after a restart either way, but the standard image currently skips its own shutdown on everydocker stop. I'd be happy to put up a PR once the approach is accepted.All reactions