* [gentoo-user] Power butten
@ 2006-09-14 22:17 rob
2006-09-14 23:24 ` George Prowse
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: rob @ 2006-09-14 22:17 UTC (permalink / raw
To: gentoo-user
How do you get power pitten to shutdown and power off Gentoo box????
rob
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-14 22:17 [gentoo-user] Power butten rob
@ 2006-09-14 23:24 ` George Prowse
2006-09-14 23:25 ` Iain Buchanan
2006-09-15 1:46 ` Ryan Tandy
2 siblings, 0 replies; 15+ messages in thread
From: George Prowse @ 2006-09-14 23:24 UTC (permalink / raw
To: gentoo-user
Press and hold in for 3-5 seconds, that is a hard shutdown if it wont turn off
George
On 14/09/06, rob <gentoo@kd4ccd.dynalias.org> wrote:
> How do you get power pitten to shutdown and power off Gentoo box????
>
> rob
> --
> gentoo-user@gentoo.org mailing list
>
>
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-14 22:17 [gentoo-user] Power butten rob
2006-09-14 23:24 ` George Prowse
@ 2006-09-14 23:25 ` Iain Buchanan
2006-09-15 1:57 ` Daniel Iliev
2006-09-15 1:46 ` Ryan Tandy
2 siblings, 1 reply; 15+ messages in thread
From: Iain Buchanan @ 2006-09-14 23:25 UTC (permalink / raw
To: gentoo-user
On Thu, 2006-09-14 at 18:17 -0400, rob wrote:
> How do you get power pitten to shutdown and power off Gentoo box????
What happens now when you press the power button? What does your syslog
say?
First of all, you need an ATX motherboard. (Any motherboard newer than
about 7/8 or so years ago). Then you need ACPI compiled into your
kernel, as well as `emerge acpid`.
Finally, if it still doesn't work, post what you see from
tail -f /var/log/messages
or whatever your syslog is, when you press the power button.
post back if that doesn't work!
--
Iain Buchanan <iaindb at netspace dot net dot au>
If you fail to plan, plan to fail.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-14 22:17 [gentoo-user] Power butten rob
2006-09-14 23:24 ` George Prowse
2006-09-14 23:25 ` Iain Buchanan
@ 2006-09-15 1:46 ` Ryan Tandy
2006-09-16 1:17 ` The Big Red Button - was " Andrew Lowe
2 siblings, 1 reply; 15+ messages in thread
From: Ryan Tandy @ 2006-09-15 1:46 UTC (permalink / raw
To: gentoo-user
rob wrote:
> How do you get power pitten to shutdown and power off Gentoo box????
>
> rob
# emerge sys-power/acpid
# rc-update add acpid default
# /etc/init.d/acpid start
and you're done! The default configuration for acpid includes a handler
for the power button event.
HTH.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-14 23:25 ` Iain Buchanan
@ 2006-09-15 1:57 ` Daniel Iliev
2006-09-15 10:47 ` Mick
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Iliev @ 2006-09-15 1:57 UTC (permalink / raw
To: gentoo-user
Iain Buchanan wrote:
> On Thu, 2006-09-14 at 18:17 -0400, rob wrote:
>
>> How do you get power pitten to shutdown and power off Gentoo box????
>>
>
> What happens now when you press the power button? What does your syslog
> say?
>
> First of all, you need an ATX motherboard. (Any motherboard newer than
> about 7/8 or so years ago). Then you need ACPI compiled into your
> kernel, as well as `emerge acpid`.
>
> Finally, if it still doesn't work, post what you see from
> tail -f /var/log/messages
> or whatever your syslog is, when you press the power button.
>
> post back if that doesn't work!
>
Only a small addition to Mr. Iain Buchanan's reply.
You have to activate "button" under ACPI in the kernel:
cd /usr/src/linux && make menuconfig
-> Power management options (ACPI, APM) ->
ACPI (Advanced Configuration and Power Interface) Support
-> Button <*> ---- here say "YES"
After emergeing acpid and runing it, you should have "shutdown now"
mapped to your power button.
--
Best regards,
Daniel
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 1:57 ` Daniel Iliev
@ 2006-09-15 10:47 ` Mick
2006-09-15 10:58 ` Bo Ørsted Andresen
0 siblings, 1 reply; 15+ messages in thread
From: Mick @ 2006-09-15 10:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 824 bytes --]
Don't mean to hijack this thread, but my situation is probably similar to the
OP.
On Friday 15 September 2006 02:57, Daniel Iliev wrote:
> Iain Buchanan wrote:
> > Finally, if it still doesn't work, post what you see from
> > tail -f /var/log/messages
> > or whatever your syslog is, when you press the power button.
ACPI event unhandled: button/sleep C1A3 00000080 00000001
> You have to activate "button" under ACPI in the kernel:
I have this activated, but nothing happens other than the unhandled event
error above.
> After emergeing acpid and runing it, you should have "shutdown now"
> mapped to your power button.
I would rather have hibernate mapped to it. How?
PS. I think that sleep (save to RAM) does not work on this laptop, not when X
is running anyway.
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 10:47 ` Mick
@ 2006-09-15 10:58 ` Bo Ørsted Andresen
2006-09-15 19:22 ` Mick
0 siblings, 1 reply; 15+ messages in thread
From: Bo Ørsted Andresen @ 2006-09-15 10:58 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]
On Friday 15 September 2006 12:47, Mick wrote:
> Don't mean to hijack this thread, but my situation is probably similar to
> the OP.
>
> On Friday 15 September 2006 02:57, Daniel Iliev wrote:
> > Iain Buchanan wrote:
> > > Finally, if it still doesn't work, post what you see from
> > > tail -f /var/log/messages
> > > or whatever your syslog is, when you press the power button.
>
> ACPI event unhandled: button/sleep C1A3 00000080 00000001
>
> > You have to activate "button" under ACPI in the kernel:
>
> I have this activated, but nothing happens other than the unhandled event
> error above.
>
> > After emergeing acpid and runing it, you should have "shutdown now"
> > mapped to your power button.
>
> I would rather have hibernate mapped to it. How?
>
> PS. I think that sleep (save to RAM) does not work on this laptop, not when
> X is running anyway.
Perhaps [1] will give you a clue. Otherwise feel free to ask again.
[1] http://gentoo-wiki.com/HOWTO_Shutdown_headless_server_when_power-button_pressed
--
Bo Andresen
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 10:58 ` Bo Ørsted Andresen
@ 2006-09-15 19:22 ` Mick
2006-09-15 20:18 ` Nico Schümann
0 siblings, 1 reply; 15+ messages in thread
From: Mick @ 2006-09-15 19:22 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]
On Friday 15 September 2006 11:58, Bo Ørsted Andresen wrote:
> Perhaps [1] will give you a clue. Otherwise feel free to ask again.
>
> [1]
> http://gentoo-wiki.com/HOWTO_Shutdown_headless_server_when_power-button_pre
>ssed
Thanks! I hadn't spotted this article. I've tried adding the following two
lines in /etc/acpid/event/default but nothing much happened (as per the log
further down):
event=button[ /]power.*
action=/usr/sbin/hibernate-ram
This is the log:
========================================
==> /var/log/acpid <==
[Fri Sep 15 19:59:26 2006] received event "button/sleep C1A3 00000080
00000006"
[Fri Sep 15 19:59:26 2006] executing action "/etc/acpi/default.sh button/sleep
C1A3 00000080 00000006"
[Fri Sep 15 19:59:26 2006] BEGIN HANDLER MESSAGES
[Fri Sep 15 19:59:26 2006] END HANDLER MESSAGES
[Fri Sep 15 19:59:26 2006] action exited with status 0
[Fri Sep 15 19:59:26 2006] completed event "button/sleep C1A3 00000080
00000006"
==> /var/log/messages <==
Sep 15 19:59:26 lappy logger: ACPI event unhandled: button/sleep C1A3 00000080
00000006
Sep 15 19:59:26 lappy logger: ACPI event unhandled: button/sleep C1A3 00000080
00000006
========================================
It's as if the two lines I've added were ignored.
This is what dmesg shows about C1A3:
========================================
# dmesg | grep -i C1A3
ACPI: Sleep Button (CM) [C1A3]
C052 C17E C185 C0A4 C0AA C19F C1A0 C1A3 C1A4
========================================
What now?
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 19:22 ` Mick
@ 2006-09-15 20:18 ` Nico Schümann
2006-09-15 22:36 ` Mick
0 siblings, 1 reply; 15+ messages in thread
From: Nico Schümann @ 2006-09-15 20:18 UTC (permalink / raw
To: gentoo-user
2006/9/15, Mick <michaelkintzios@gmail.com>:
> On Friday 15 September 2006 11:58, Bo Ørsted Andresen wrote:
> Thanks! I hadn't spotted this article. I've tried adding the following two
> lines in /etc/acpid/event/default but nothing much happened (as per the log
> further down):
>
> event=button[ /]power.*
> action=/usr/sbin/hibernate-ram
Well, my configuration slightly differs from your one.
--- /etc/acpid/events/default
>event=.*
>action=/etc/acpi/default.sh %e
--- /etc/acpid/default.sh
>set $*
>
>group=${1/\/*/}
>action=${1/*\//}
>
>case "$group" in
> button)
> case "$action" in
> power) echo disk > /sys/power/state
> ;;
> sleep) echo disk > /sys/power/state
> ;;
> *) logger "ACPI action $action is not defined"
> ;;
> esac
> ;;
>
> *)
> logger "ACPI group $group / action $action is not defined"
> ;;
>esac
button/power and button/sleep are _not_ the same and as the log tells
us, it's a button/sleep event. If I get this right, in your
configuration, only a button/power is handeled.
Regards,
Nico
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 20:18 ` Nico Schümann
@ 2006-09-15 22:36 ` Mick
2006-09-15 23:53 ` Richard Fish
0 siblings, 1 reply; 15+ messages in thread
From: Mick @ 2006-09-15 22:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3183 bytes --]
On Friday 15 September 2006 21:18, Nico Schümann wrote:
> Well, my configuration slightly differs from your one.
> --- /etc/acpid/events/default
>
> >event=.*
> >action=/etc/acpi/default.sh %e
No it doesn't really. The default entries in mine were as you show above. I
just followed the comments in the file to separately define what should
happen when the power button is pressed, but it didn't work anyway.
> --- /etc/acpid/default.sh
>
> >set $*
> >
> >group=${1/\/*/}
> >action=${1/*\//}
> >
> >case "$group" in
> > button)
> > case "$action" in
> > power) echo disk > /sys/power/state
> > ;;
> > sleep) echo disk > /sys/power/state
> > ;;
> > *) logger "ACPI action $action is not
> > defined" ;;
> > esac
> > ;;
> >
> > *)
> > logger "ACPI group $group / action $action is not defined"
> > ;;
> >esac
>
> button/power and button/sleep are _not_ the same and as the log tells
> us, it's a button/sleep event. If I get this right, in your
> configuration, only a button/power is handeled.
What/who determines what goes in /etc/acpid/default.sh? This is what's in
mine:
===============================================
#!/bin/sh
# /etc/acpi/default.sh
# Default acpi script that takes an entry for all actions
set $*
group=${1/\/*/}
action=${1/*\//}
device=$2
id=$3
value=$4
log_unhandled() {
logger "ACPI event unhandled: $*"
}
case "$group" in
button)
case "$action" in
power)
/sbin/init 0
;;
# if your laptop doesnt turn on/off the display via
hardware
# switch and instead just generates an acpi event, you
can force
# X to turn off the display via dpms. note you will
have to run
# 'xhost +local:0' so root can access the X DISPLAY.
#lid)
# xset dpms force off
# ;;
*) log_unhandled $* ;;
esac
;;
ac_adapter)
case "$value" in
# Add code here to handle when the system is unplugged
# (maybe change cpu scaling to powersave mode)
#*0)
# ;;
# Add code here to handle when the system is plugged
in
# (maybe change cpu scaling to performance mode)
#*1)
# ;;
*) log_unhandled $* ;;
esac
;;
*) log_unhandled $* ;;
esac
===============================================
I don't really understand what this script is telling me. :-(
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 22:36 ` Mick
@ 2006-09-15 23:53 ` Richard Fish
2006-09-16 10:25 ` Mick
0 siblings, 1 reply; 15+ messages in thread
From: Richard Fish @ 2006-09-15 23:53 UTC (permalink / raw
To: gentoo-user
On 9/15/06, Mick <michaelkintzios@gmail.com> wrote:
> case "$group" in
> button)
> case "$action" in
> power)
> /sbin/init 0
> ;;
You need to add a "sleep" case here to do whatever you want to happen
when you press the pwer button...
> *) log_unhandled $* ;;
...or this case is executed. The "log_unhandled" function generates a
message in the form of:
ACPI event unhandled: button/foo
Sound familiar? ;-)
So if you want power to shutdown nicely, try adding:
sleep)
/sbin/init 0
-Richard
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* The Big Red Button - was Re: [gentoo-user] Power butten
2006-09-15 1:46 ` Ryan Tandy
@ 2006-09-16 1:17 ` Andrew Lowe
2006-09-16 11:37 ` William Kenworthy
2006-09-17 5:15 ` Iain Buchanan
0 siblings, 2 replies; 15+ messages in thread
From: Andrew Lowe @ 2006-09-16 1:17 UTC (permalink / raw
To: gentoo-user
Ryan Tandy wrote:
> rob wrote:
>> How do you get power pitten to shutdown and power off Gentoo box????
>>
>> rob
>
> # emerge sys-power/acpid
> # rc-update add acpid default
> # /etc/init.d/acpid start
>
> and you're done! The default configuration for acpid includes a handler
> for the power button event.
>
> HTH.
Just a slight hijacking of this topic,
I have a little EPIA server acting as firewall, npt, dhcp, dns,etc,etc.
Now even though it doesn't pull a lot of power, I don't want it running
all the time, it has something to do with missing ice caps. So I want to
build a button that attaches to the machine via, say, usb that when
pushed shuts the machine down. By a button I mean that sort of emergency
shutdown button that is usually red and used in industrial control, the
sort of thing the hero always has to push to save the heroine/world.
Does anyone here have enough hardware design knowledge to say if this
would be easy or not and as to whether I should just lower my sights and
stick to the three finger salute or the "normal" on/off switch?
Regards,
Andrew
p.s. The main reason driving this is that the wife never turns the
server off. If I have a Big Red Switch, I can say "But it has a big red
switch, how can you miss it????"
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Power butten
2006-09-15 23:53 ` Richard Fish
@ 2006-09-16 10:25 ` Mick
0 siblings, 0 replies; 15+ messages in thread
From: Mick @ 2006-09-16 10:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1426 bytes --]
On Saturday 16 September 2006 00:53, Richard Fish wrote:
> You need to add a "sleep" case here to do whatever you want to happen
> when you press the pwer button...
Thanks Richard,
I have added this:
===============================================
case "$group" in
button)
case "$action" in
power)
/sbin/init 0
;;
sleep)
/usr/sbin/hibernate
;;
# if your laptop doesnt turn on/off the display via
hardware
# switch and instead just generates an acpi event, you
can force
# X to turn off the display via dpms. note you will
have to run
# 'xhost +local:0' so root can access the X DISPLAY.
#lid)
# xset dpms force off
# ;;
*) log_unhandled $* ;;
esac
;;
===============================================
and it now hibernates nicely. I have another acpi event question, but I'll
start a new thread for it since it is not relevant.
I hope my question and answers I received have satisfied the OP requirements
too.
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: The Big Red Button - was Re: [gentoo-user] Power butten
2006-09-16 1:17 ` The Big Red Button - was " Andrew Lowe
@ 2006-09-16 11:37 ` William Kenworthy
2006-09-17 5:15 ` Iain Buchanan
1 sibling, 0 replies; 15+ messages in thread
From: William Kenworthy @ 2006-09-16 11:37 UTC (permalink / raw
To: gentoo-user
use a usb mouse - dismantle it and use your big red button to close the
left mouse switch (or better one of the aux ones if they exist). Map
this to shutdown the system.
BillK
On Sat, 2006-09-16 at 11:17 +1000, Andrew Lowe wrote:
> Ryan Tandy wrote:
> > rob wrote:
> >> How do you get power pitten to shutdown and power off Gentoo box????
>
> Just a slight hijacking of this topic,
> I have a little EPIA server acting as firewall, npt, dhcp, dns,etc,etc.
> Now even though it doesn't pull a lot of power, I don't want it running
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: The Big Red Button - was Re: [gentoo-user] Power butten
2006-09-16 1:17 ` The Big Red Button - was " Andrew Lowe
2006-09-16 11:37 ` William Kenworthy
@ 2006-09-17 5:15 ` Iain Buchanan
1 sibling, 0 replies; 15+ messages in thread
From: Iain Buchanan @ 2006-09-17 5:15 UTC (permalink / raw
To: gentoo-user
On Sat, 2006-09-16 at 11:17 +1000, Andrew Lowe wrote:
>
> Just a slight hijacking of this topic,
> I have a little EPIA server acting as firewall, npt, dhcp, dns,etc,etc.
> Now even though it doesn't pull a lot of power, I don't want it running
> all the time, it has something to do with missing ice caps. So I want to
> build a button that attaches to the machine via, say, usb that when
> pushed shuts the machine down. By a button I mean that sort of emergency
> shutdown button that is usually red and used in industrial control, the
> sort of thing the hero always has to push to save the heroine/world.
don't know about the James Bond stuff - you'd probably also need an lcd
countdown where the button only works if you press it on 007...
anyway, you probably don't want to go exactly the way of the industrial
Emergency Stop, as it's a hardware cutoff - ie. power is shut of
straight away, without any software intervention. Your disks will
probably survive the unclean unmounts, and you power supply may handle
the voltage / frequency spikes from the switch opening, but why bother?
If you really want, you can pick them up from any electrical distributer
(in Australia anyway)...
> Does anyone here have enough hardware design knowledge to say if this
> would be easy or not and as to whether I should just lower my sights and
> stick to the three finger salute or the "normal" on/off switch?
If I were you, I'd want to stay with the ACPI power button, most popular
OS's can detect this nicely. What you can do is this:
- "splice" the power switch cable (the motherboard/case one, NOT the
power supply side!). The button works by completing a circuit to the
motherboard when pressed, so you can have two buttons doing the same
thing on the same circuit. Join a new wire of each of the two existing
wires. (Inside your case, they're usually labelled PWRSW or something).
- buy any sort of big red button (normally open, non latching) and wire
it to the two new wires. I have a nice arcade "fire" button which would
do the trick.
- stick it on the top / front of your case with a sign saying "PRESS
ME" (or maybe "don't touch" if you want to go for the reverse psychology
angle...)
voila!
> p.s. The main reason driving this is that the wife never turns the
> server off. If I have a Big Red Switch, I can say "But it has a big red
> switch, how can you miss it????"
you could try some "reNedufication", or perhaps a script that detects
how many users are logged in and for how long, and then shutdown
automatically. Or just shutdown at midnight (or whatever time she's
guaranteed not to be on...
--
Iain Buchanan <iaindb at netspace dot net dot au>
fortune: cannot execute. Out of cookies.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2006-09-17 5:20 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-14 22:17 [gentoo-user] Power butten rob
2006-09-14 23:24 ` George Prowse
2006-09-14 23:25 ` Iain Buchanan
2006-09-15 1:57 ` Daniel Iliev
2006-09-15 10:47 ` Mick
2006-09-15 10:58 ` Bo Ørsted Andresen
2006-09-15 19:22 ` Mick
2006-09-15 20:18 ` Nico Schümann
2006-09-15 22:36 ` Mick
2006-09-15 23:53 ` Richard Fish
2006-09-16 10:25 ` Mick
2006-09-15 1:46 ` Ryan Tandy
2006-09-16 1:17 ` The Big Red Button - was " Andrew Lowe
2006-09-16 11:37 ` William Kenworthy
2006-09-17 5:15 ` Iain Buchanan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox