From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 22 17:07:38 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3AE31065673 for ; Sun, 22 Jan 2012 17:07:38 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [76.96.30.64]) by mx1.freebsd.org (Postfix) with ESMTP id A95C88FC0A for ; Sun, 22 Jan 2012 17:07:38 +0000 (UTC) Received: from omta08.emeryville.ca.mail.comcast.net ([76.96.30.12]) by qmta07.emeryville.ca.mail.comcast.net with comcast id Qh6m1i0070FhH24A7h7eK2; Sun, 22 Jan 2012 17:07:38 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta08.emeryville.ca.mail.comcast.net with comcast id Qh7d1i00W4NgCEG8Uh7dmb; Sun, 22 Jan 2012 17:07:38 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q0MH7Zkg010727; Sun, 22 Jan 2012 10:07:35 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: geoffrey levand In-Reply-To: References: Content-Type: text/plain; charset="koi8-r" Date: Sun, 22 Jan 2012 10:07:35 -0700 Message-Id: <1327252055.69022.46.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.26.0 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: freebsd-hackers Subject: Re: Rebooting/Halting system from kernel module X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 17:07:38 -0000 On Sun, 2012-01-22 at 14:19 +0400, geoffrey levand wrote: > Hi, > > how would i reboot/halt the system from a kernel module ? > > regards > > -- > Почта@Mail.Ru в твоем мобильном! > Просто зайди с телефона на m.mail.ru There is an undocumented (at least in terms of a manpage) function named shutdown_nice() in sys/kern/kern_shutdown.c that will send a signal to the init process if it's running or call boot(9) if not. Or maybe a direct call to boot(9) is what you're looking for, if bypassing the running of rc shutdown scripts and all is your goal. (There is a mapage for boot(9)). -- Ian