From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753244AbbCaWjR (ORCPT ); Tue, 31 Mar 2015 18:39:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54646 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964AbbCaWjO (ORCPT ); Tue, 31 Mar 2015 18:39:14 -0400 Date: Tue, 31 Mar 2015 15:39:12 -0700 From: Andrew Morton To: Joel Stanley Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, fabf@skynet.be, benh@kernel.crashing.org, mpe@ellerman.id.au, rusty@rustcorp.com.au, jk@ozlabs.org Subject: Re: [PATCH 1/2] kernel/reboot.c: Add orderly_reboot for graceful reboot Message-Id: <20150331153912.267c0b1af94b5f4964d791de@linux-foundation.org> In-Reply-To: <1427681733-25488-1-git-send-email-joel@jms.id.au> References: <1427681733-25488-1-git-send-email-joel@jms.id.au> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Mar 2015 12:45:32 +1030 Joel Stanley wrote: > The kernel has orderly_poweroff which allows the kernel to initiate a > graceful shutdown of userspace, by running /sbin/poweroff. This adds > orderly_reboot that will cause userspace to shut itself down by calling > /sbin/reboot. > > This will be used for shutdown initiated by a system controller on > platforms that do not use ACPI. gee. There are a lot of callers of emergency_restart(). Why is the BMC reboot special, and how many of the emergency_restart() callers really be using orderly_reboot()? We have /proc/sys/kernel/poweroff_cmd. Should we have /proc/sys/kernel/reboot_cmd as well? If not, kernel/reboot.c:reboot_cmd[] can be made static ;)