From netch@iv.nn.kiev.ua  Wed Jun 13 00:21:05 2001
Return-Path: <netch@iv.nn.kiev.ua>
Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4])
	by hub.freebsd.org (Postfix) with ESMTP id B78E837B408
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Jun 2001 00:21:01 -0700 (PDT)
	(envelope-from netch@iv.nn.kiev.ua)
Received: (from uucp@localhost)
	by segfault.kiev.ua (8) with UUCP id KIB44049;
	Wed, 13 Jun 2001 10:20:58 +0300 (EEST)
	(envelope-from netch@iv.nn.kiev.ua)
Received: (from netch@localhost)
	by iv.nn.kiev.ua (8.11.3/8.11.3) id f5D7Jpr00636;
	Wed, 13 Jun 2001 10:19:51 +0300 (EEST)
	(envelope-from netch)
Message-Id: <200106130719.f5D7Jpr00636@iv.nn.kiev.ua>
Date: Wed, 13 Jun 2001 10:19:51 +0300 (EEST)
From: netch@netch.kiev.ua (Valentin Nechayev)
Reply-To: netch@netch.kiev.ua
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: init: allow reboot during runcom
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28116
>Category:       bin
>Synopsis:       init: allow reboot during runcom
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 13 00:30:11 PDT 2001
>Closed-Date:    Mon Oct 22 05:24:54 PDT 2001
>Last-Modified:  Mon Oct 22 05:25:46 PDT 2001
>Originator:     Valentin Nechayev
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
private
>Environment:

FreeBSD 4.3-STABLE i386

>Description:

/sbin/init does not react on Ctrl-Alt-Del in "runcom" state (during running
/etc/rc). If boot process hangs (even some fresh FreeBSD ports caused
hanging due to bugs in startup scripts), there often is no possibility to
interrupt it correctly (without reset button).

>How-To-Repeat:

>Fix:

In runcom(), init does not check for transitions requested from signal
handlers before /etc/rc finished. Modify it to check for `death'.

Patch to RELENG_4 (but also applicable cleanly to HEAD):

--- /usr/src/sbin/init/init.c.orig	Sat May 26 21:48:37 2001
+++ /usr/src/sbin/init/init.c	Wed Jun 13 09:44:00 2001
@@ -798,10 +798,13 @@
 	/*
 	 * Copied from single_user().  This is a bit paranoid.
 	 */
+	requested_transition = 0;
 	do {
 		if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1)
 			collect_child(wpid);
 		if (wpid == -1) {
+			if (requested_transition == death)
+				return death;
 			if (errno == EINTR)
 				continue;
 			warning("wait for %s on %s failed: %m; going to single user mode",
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Wed Jun 13 11:56:15 PDT 2001 
Responsible-Changed-Why:  
I'll handle this one. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28116 
State-Changed-From-To: open->feedback 
State-Changed-By: des 
State-Changed-When: Mon Oct 15 13:33:32 PDT 2001 
State-Changed-Why:  
Committed, awaiting MFC. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28116 
State-Changed-From-To: feedback->closed 
State-Changed-By: des 
State-Changed-When: Mon Oct 22 05:24:54 PDT 2001 
State-Changed-Why:  
Fixed, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28116 
>Unformatted:
