From nobody@FreeBSD.org  Thu Feb 17 19:10:22 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9403116A500
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Feb 2005 19:10:22 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7968443D2F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Feb 2005 19:10:22 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1HJAM3Z039473
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Feb 2005 19:10:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j1HJAM6Y039472;
	Thu, 17 Feb 2005 19:10:22 GMT
	(envelope-from nobody)
Message-Id: <200502171910.j1HJAM6Y039472@www.freebsd.org>
Date: Thu, 17 Feb 2005 19:10:22 GMT
From: Sandeep Kumar <sandkumar@juniper.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: init can loose shutdown related signals
X-Send-Pr-Version: www-2.3

>Number:         77651
>Category:       bin
>Synopsis:       [patch] init(8) can lose shutdown related signals
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 17 19:20:13 GMT 2005
>Closed-Date:    
>Last-Modified:  Sun Jul 01 15:59:49 UTC 2012
>Originator:     Sandeep Kumar
>Release:        4.10
>Organization:
Juniper Networks
>Environment:
FreeBSD bbuild26 4.10-PRERELEASE-20040428 FreeBSD 4.10-PRERELEASE-20040428 #0: Tue May 18 11:57:20 PDT 2004     root@bbuild26.juniper.net:/usr/src/sys/compile/bbuild26  i386


>Description:
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  
>How-To-Repeat:
Create a big /etc/ttys.
kill -1 1; shutdown -r now

Lot of times the machine will not reboot.
>Fix:
While returning, clean_ttys should check if requested_transition is
no longer clean_ttys and then return requested_transition
instead of multi_user
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: vwe 
State-Changed-When: Wed Aug 18 18:01:21 UTC 2010 
State-Changed-Why:  
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? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77651 
State-Changed-From-To: analyzed->open 
State-Changed-By: eadler 
State-Changed-When: Sun Jul 1 15:59:48 UTC 2012 
State-Changed-Why:  
unowned PRs should not be in analyzed state 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77651 
>Unformatted:
