Skip to content

fix: signal entire process group on Unix shutdown#8

Merged
haydenk merged 4 commits intodevelopfrom
bugfix/signal-process-group-unix
Mar 24, 2026
Merged

fix: signal entire process group on Unix shutdown#8
haydenk merged 4 commits intodevelopfrom
bugfix/signal-process-group-unix

Conversation

@haydenk
Copy link
Owner

@haydenk haydenk commented Mar 24, 2026

Summary

  • Fixes Fix: signal entire process group on terminate/kill (Unix) #7 — signals are now sent to the entire process group (-pgid) so grandchildren (e.g. workers spawned by sh) also receive SIGTERM/SIGKILL on shutdown
  • Each child process is placed in its own process group via SysProcAttr{Setpgid: true} so the group kill is scoped correctly
  • Falls back to signalling the individual process if the group kill fails
  • Also fixes the lint task to correctly locate and invoke staticcheck when it is installed in $GOBIN but not on $PATH

Test plan

  • Start a Procfile app where a process spawns child processes (e.g. php-fpm, a shell wrapper)
  • Send SIGTERM / Ctrl-C and verify all grandchildren are terminated, not just the direct child
  • Run mise run lint in a clean env where staticcheck is not on $PATH and verify it still runs

🤖 Generated with Claude Code

@haydenk haydenk merged commit 5b5bc7e into develop Mar 24, 2026
4 checks passed
@haydenk haydenk deleted the bugfix/signal-process-group-unix branch March 24, 2026 18:37
haydenk added a commit that referenced this pull request Mar 24, 2026
* cross build support

* Fix test

* fix trigger release when tag created

* fix: signal entire process group on Unix shutdown (#8)

* Fixes #7 - signal process fix

* fix linting command to install staticheck

* update command initialization

* update changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: signal entire process group on terminate/kill (Unix)

1 participant