From owner-freebsd-bugs Wed Jun 13 0:30:23 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id F052E37B407 for ; Wed, 13 Jun 2001 00:30:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5D7UBi44512; Wed, 13 Jun 2001 00:30:11 -0700 (PDT) (envelope-from gnats) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by hub.freebsd.org (Postfix) with ESMTP id B78E837B408 for ; 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 X-Send-Pr-Version: 3.113 Subject: bin/28116: init: allow reboot during runcom Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 28116 >Category: bin >Synopsis: init: allow reboot during runcom >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 13 00:30:11 PDT 2001 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message