Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Apr 2013 06:05:07 +0200
From:      Polytropon <freebsd@edvax.de>
To:        "Ronald F. Guilmette" <rfg@tristatelogic.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Power switch not working
Message-ID:  <20130407060507.76fd8bd1.freebsd@edvax.de>
In-Reply-To: <2317.1365306718@server1.tristatelogic.com>
References:  <2317.1365306718@server1.tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 06 Apr 2013 20:51:58 -0700, Ronald F. Guilmette wrote:
> I'll be attending to those thing, but for now I'd just like to know
> why, when I do "shutdown -h now" and then let the system come down to
> the point where it says "Press any key to reboot" pressing the power
> switch at that point no longer causes the system to actually power down.
> If fact it does nothing.

This is to be expected. When you press the power switch, a
signal will be sent to the OS which causes a "custom action",
which in most cases is to shutdown the system and then power
it off. This is what "shutdown -p now" does.

When you use "shutdown -h now" the system will be shut down.
When you _then_ press the button, there's nothing left to
act. Your only choice is to hold the button for about 4 seconds
which will cause a "hardware switch-off".

Just a question: Why don't you simply press the button from
out of a "safe" system state (e. g. when you've logged out)?
It will cause the "ACPI message system" to tell the OS to
shut down and power off - which you seem to intend.

For example, I've programmed Ctrl+Alt+Moon on my Sun USB keyboard
to exactly perform that action. But I can press the button
at any time to have the same operation performed.



> I'm guessing that this relates to some BIOS setting that I need to diddle,
> but which one?  Something to do with ACPI?

Usually the BIOS settings are okay for the normal case: to
send the "shutdown + poweroff signal". However, you can select
the other variant, "immediately power off" ("forced power off")
in the CMOS setup. Pressing the button, even with a running OS,
will then switch the machine off, no matter in which state it is.



> I'm ignorant about this stuff.  Guidance would be appreciated.  Thanks.

In the past, this kind of operation has been performed via APM.
When APM has been fully supported, it was abolished and replaced
by ACPI. At the time ACPI is fully working, standard-compliant
and supported among all the many vendors, it will be obsoleted
by something different, probably UEFI, and the fun restarts. :-)



> P.S.   I *did* hook up the case power switch correctly.  It does do the
> Right Thing when I'm just in the BIOS.

This is also to be expected: In the BIOS, and _any_ stage prior
to loading the OS, there will be only one thing the button can
do: power the system off immediately.



> But running FreeBSD seems to
> cause it (the case power switch) to be ignored.

Check the BIOS settings, the switch should be programmed to
something like "soft power-off", it's "the other thing" to
whatever caption has been chosen for "immediately power
off" (forced by the 4 second press).

When in FreeBSD, pressing the button should shutdown the
system and then power it off. Allow this process few seconds
to work. You can easily examine if it's working properly
when you have a look at the system messages on ttyv0.

I cannot remember the correct messages because I'm too lazy
to press this switch when Ctrl+Alt+Moon is so much more
comfortable - thank you, Sun Microsystems. :-)

If this does _not_ happen, the BIOS setting makes the button
send the wrong "message" (maybe "sleep" or some other strange
ACPI stuff).



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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