Bug 77651 - [patch] init(8) can lose shutdown related signals
Summary: [patch] init(8) can lose shutdown related signals
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-17 19:20 UTC by Sandeep Kumar
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandeep Kumar 2005-02-17 19:20:13 UTC
When init receives SIGHUP, the state machine's requested_transition is changed to clean_ttys. Lets say SIGTERM is received while we are in clean_ttys, it will set requested_transition to death. But at the end of clean_ttys it will return multi_user directly which then resets requested_transition. So we loose the SIGTERM sent by shutdown

Fix: 

While returning, clean_ttys should check if requested_transition is
no longer clean_ttys and then return requested_transition
instead of multi_user
How-To-Repeat: Create a big /etc/ttys.
kill -1 1; shutdown -r now

Lot of times the machine will not reboot.
Comment 1 Volker Werth freebsd_committer 2010-08-18 19:01:21 UTC
State Changed
From-To: open->analyzed

this is not just possible, it does happen frequently. I'm seeing this @ work several times a week. 
If a script fires a signal to reboot and a few moments later, another instruction tells init to just shutdown, init will forget about the reboot. 
I've created a patch for that problem, which solves that problem (stress tested my notebook with that): 
http://people.freebsd.org/~vwe/files/patches/pr77651_init.c.diff 

Who's going to commit?
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-07-01 16:59:48 UTC
State Changed
From-To: analyzed->open

unowned PRs should not be in analyzed state
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped