Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2015 15:38:39 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-acpi@freebsd.org
Cc:        Jung-uk Kim <jkim@freebsd.org>, Colin Percival <cperciva@freebsd.org>, Anthony Jenkins <Scoobi_doo@yahoo.com>
Subject:   Re: disabling sleep when shutting down
Message-ID:  <1905488.VHUbJhcB3l@ralph.baldwin.cx>
In-Reply-To: <5601A863.5070406@FreeBSD.org>
References:  <55FA3848.7090802@freebsd.org> <55FE5D54.1030806@freebsd.org> <5601A863.5070406@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, September 22, 2015 03:13:39 PM Jung-uk Kim wrote:
> > On 09/20/2015 03:16, Colin Percival wrote:
> >> On 09/18/15 11:29, Anthony Jenkins wrote:
> >>> Is it possible for /etc/rc.shutdown to complete, but shutdown
> >>> not occur?  If so, there should be a mechanism to restore the
> >>> ability to suspend.  Other than that, I like it.
> >>
> >> Hmm... well, rc.shutdown runs before the system drops into
> >> single-user mode.  Which makes me think that maybe we should be
> >> making the kernel call from inside init instead of from
> >> rc.shutdown.
> >
> > I didn't want to pollute init with arch-dependent hacks. Anyway,
> > the attached patch should do what you want (not tested).
> 
> Or a simpler hack with sysctl(3) instead of ioctl(2).

I kind of think just setting the LID switch sysctl during shutdown
is probably fine.

That said, if you want to do this in the kernel, there's no reason to
make this x86-specific.  powerpc laptops can suspend but don't use
ACPI to do so.  Can you just have an MI sysctl that init frobs?  It
doesn't hurt to do so on platforms that don't support suspending (the
knob would just be a no-op).

-- 
John Baldwin



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