Systemd does not send SIGTERM first on shutdown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd |
Invalid
|
Undecided
|
|||
systemd (Debian) |
Fix Released
|
Unknown
|
|||
systemd (Fedora) |
Invalid
|
Undecided
|
|||
systemd (Ubuntu) |
Fix Released
|
High
|
Martin Pitt | ||
Vivid |
Fix Released
|
High
|
Martin Pitt |
Bug Description
It has been normal that applications first get the SIGTERM signal before SIGKILL on shutdown/reboot in order to successfully finish any pending tasks. Now it seem this logic has been changed to something else, causing problems to mosh and many others:
https:/
SIGTERM suggestion can be seen here:
http://
I created this error report to find out the correct way for applications to fix this problem or to create one fix to systemd, bringing back the old "BSD shutdown" functionality.
This report is for Ubuntu 15.04.
SRU TEST CASE:
- Open a terminal, enter some commands, then run "reboot".
- After a reboot, chances are very high that your bash history does not contain your most recently typed commands
- With the updated package, the bash history should be intact.
REGRESSION POTENTIAL:
- The original commit was applied because of an inherent race condition with cgroup's release_agent -- in rare corner cases an nspawn container (probably also LXC) can miss them. In that case it's possible that you instead get a 90s timeout on the unit that is shutting down. But this does not mean data loss, just a rare shutdown hang from containers (for the record, I never actually saw that hanging with LXC), so I think it's a good trade-off.
Changed in systemd (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Martin Pitt (pitti) |
status: | Confirmed → In Progress |
tags: | added: systemd-bugs |
summary: |
- Systemd has wrong kill mode on shutdown + Systemd does not send SIGTERM first on shutdown |
Changed in systemd (Ubuntu Vivid): | |
milestone: | none → vivid-updates |
description: | updated |
description: | updated |
Changed in systemd (Ubuntu): | |
milestone: | vivid-updates → none |
tags: |
added: verification-done removed: verification-needed |
tags: |
added: systemd-boot removed: systemd-bugs |
Changed in systemd (Debian): | |
status: | Unknown → Fix Committed |
Changed in systemd (Debian): | |
status: | Fix Committed → Fix Released |
Changed in systemd: | |
importance: | Unknown → Undecided |
status: | Unknown → Invalid |
Changed in systemd (Fedora): | |
importance: | Unknown → Undecided |
status: | Unknown → Invalid |
This does seem to be a systemd bug that is affecting several applications -- basically any application that would like a SIGTERM on reboot/shutdown so that it can save or clean up resources gracefully.
Please see https:/ /bugzilla. redhat. com/show_ bug.cgi? id=1141137 (upstream systemd bug)
https:/ /bugzilla. redhat. com/show_ bug.cgi? id=1170765 (bug affects bash's attempt to save history)
https:/ /github. com/cockpit- project/ cockpit/ issues/ 1155 (bug affects cockpit)
http:// lists.freedeskt op.org/ archives/ systemd- devel/2014- October/ 024452. html (discussion)