Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2012 10:07:35 -0700
From:      Ian Lepore <freebsd@damnhippie.dyndns.org>
To:        geoffrey levand <geoffrey.levand@mail.ru>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Rebooting/Halting system from kernel module
Message-ID:  <1327252055.69022.46.camel@revolution.hippie.lan>
In-Reply-To: <E1RouW1-0003BY-9s.geoffrey-levand-mail-ru@f69.mail.ru>
References:  <E1RouW1-0003BY-9s.geoffrey-levand-mail-ru@f69.mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1327252055.69022.46.camel>