Commit c8b5401
committed
fix: ignore SIGTERM in gravity child to survive systemd cgroup-level kill
setsid() was already added to detach the child from the parent's
process group, but systemd's default KillMode=control-group sends
SIGTERM to ALL processes in the cgroup, not just the process group.
After execv(), custom signal handlers are reset to SIG_DFL, so the
gravity child was still killed immediately.
Set SIG_IGN for SIGTERM before execv() since SIG_IGN (unlike custom
handlers) is preserved across exec. This lets gravity run to
completion even when FTL receives SIGTERM from systemd.
Signed-off-by: Dominik <[email protected]>1 parent 459881c commit c8b5401
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
0 commit comments