Graceful shutdown on SIGTERM caused by manual app stop#703
Conversation
WalkthroughFive S6 finish scripts ( ChangesSignal 15 guard in S6 finish scripts
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tailscale/rootfs/etc/s6-overlay/s6-rc.d/nginx/finish`:
- Line 18: Three finish scripts are missing the SIGTERM guard (`-ne 15`) that
prevents writing signal-based exit codes when services are manually stopped. In
the protect-subnets/finish, magicdns-egress-proxy/finish, and
magicdns-ingress-proxy/finish scripts, locate the condition that checks
`exit_code_container` and update it to include the `exit_code_signal -ne 15`
check alongside the existing `exit_code_container -eq 0` check, matching the
pattern already correctly implemented in nginx/finish and other scripts. This
ensures all services consistently skip writing exit codes on SIGTERM signals.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5c0d145b-8535-4e9c-b700-ea5dcce850e9
📒 Files selected for processing (5)
tailscale/rootfs/etc/s6-overlay/s6-rc.d/nginx/finishtailscale/rootfs/etc/s6-overlay/s6-rc.d/share-homeassistant/finishtailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrop/finishtailscale/rootfs/etc/s6-overlay/s6-rc.d/tailscaled/finishtailscale/rootfs/etc/s6-overlay/s6-rc.d/web/finish
Proposed Changes
This is to prevent showing "Error" app status after plain manual app stop.
Finish scripts in pending PRs #667 #680 are also modified.
Related Issues
Summary by CodeRabbit