From owner-freebsd-current@FreeBSD.ORG Tue Sep 29 14:43:49 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA975106568F; Tue, 29 Sep 2009 14:43:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7018FC1B; Tue, 29 Sep 2009 14:43:49 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1CCEF46B0D; Tue, 29 Sep 2009 10:43:49 -0400 (EDT) Date: Tue, 29 Sep 2009 15:43:49 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= In-Reply-To: <86ske5gav0.fsf@ds4.des.no> Message-ID: References: <4AC141B0.4090705@delphij.net> <86ws3iexl3.fsf@ds4.des.no> <86ske5gav0.fsf@ds4.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-1948125868-1254235429=:94746" Cc: freebsd-current@freebsd.org, Ivan Voras Subject: Re: [PATCH] Shutdown cooloff feature X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2009 14:43:49 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-1948125868-1254235429=:94746 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 29 Sep 2009, Dag-Erling Smørgrav wrote: > Ivan Voras writes: >> Dag-Erling Smørgrav writes: >>> [...] shutdown(8) sends either SIGINT, SIGUSR or SIGUSR2 to init(8), which >>> runs /etc/rc.shutdown before killing all remaining processes and either >>> reboot / halt or start a single-user shell, while reboot(8) and halt(8) >>> send SIGTSTP to init(8), then SIGTERM to every other process in the >>> system, then SIGKILL to any process that hasn't responded to SIGTERM after >>> somewhere between five and sixty seconds, before issuing a reboot(2) >>> syscall. >> Is this distinction between them useful (other than possibly speed of >> shutdown/reboot)? > > Good question. You definitely want to run rc.shutdown in the common case > (multi-user mode), but running it in single-user mode may have unintended > consequences. I could be convinced by an argument that reboot and shutdown -r should be the same, and that both should talk to init, which should perform the reboot system call. Since init is what runs rc.shutdown, and it already knows if it's in multiuser mode (since it defines multiuser mode), it should be able to DRT. My belief is that most people who type in "reboot" do so thinking it means the same thing as "shutdown -r ". Robert N M Watson Computer Laboratory University of Cambridge --621616949-1948125868-1254235429=:94746--