* [gentoo-user] 'Hibernate' by power button
@ 2007-02-16 19:01 Mick
2007-02-16 19:13 ` Raymond Lewis Rebbeck
0 siblings, 1 reply; 8+ messages in thread
From: Mick @ 2007-02-16 19:01 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 418 bytes --]
Hi All,
A few weeks ago I updated acpi and hibernate and their relevant configuration
files. Since then when I press the power button on my laptop nothing
happens.
Clearly something was changed, intentionally or otherwise, and this feature is
no longer available to me. Would you care to point me in the right
direction - how do I set my power button to run the hibernate script?
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
2007-02-16 19:01 [gentoo-user] 'Hibernate' by power button Mick
@ 2007-02-16 19:13 ` Raymond Lewis Rebbeck
2007-02-16 19:38 ` Mick
0 siblings, 1 reply; 8+ messages in thread
From: Raymond Lewis Rebbeck @ 2007-02-16 19:13 UTC (permalink / raw
To: gentoo-user
On Saturday, 17 February 2007 5:31, Mick wrote:
> Hi All,
>
> A few weeks ago I updated acpi and hibernate and their relevant
> configuration files. Since then when I press the power button on my laptop
> nothing happens.
>
> Clearly something was changed, intentionally or otherwise, and this feature
> is no longer available to me. Would you care to point me in the right
> direction - how do I set my power button to run the hibernate script?
I assume you're using acpid. Look in /etc/acpi/ there is a default script that
is run for acpi events, it handles the power button by calling /sbin/init 0.
Replace the command it runs with hibernate or similar.
--
Raymond Lewis Rebbeck
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
2007-02-16 19:13 ` Raymond Lewis Rebbeck
@ 2007-02-16 19:38 ` Mick
2007-02-16 19:49 ` Raymond Lewis Rebbeck
0 siblings, 1 reply; 8+ messages in thread
From: Mick @ 2007-02-16 19:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3317 bytes --]
On Friday 16 February 2007 19:13, Raymond Lewis Rebbeck wrote:
> On Saturday, 17 February 2007 5:31, Mick wrote:
> > Hi All,
> >
> > A few weeks ago I updated acpi and hibernate and their relevant
> > configuration files. Since then when I press the power button on my
> > laptop nothing happens.
> >
> > Clearly something was changed, intentionally or otherwise, and this
> > feature is no longer available to me. Would you care to point me in the
> > right direction - how do I set my power button to run the hibernate
> > script?
>
> I assume you're using acpid. Look in /etc/acpi/ there is a default script
> that is run for acpi events, it handles the power button by calling
> /sbin/init 0. Replace the command it runs with hibernate or similar.
Thanks Raymond, I have this in my /etc/acpi/events/default:
==========================
event=button[/]power.*
action=/usr/sbin/hibernate
==========================
but nothing happens or gets logged when I press the power button. Could this
be something to do with the /etc/acpi/default.sh file perhaps? I vaguely
remember hacking it unashamedly in the mist of time to get the button
working.
==========================
#!/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
;;
sleep)
/usr/sbin/hibernate
;;
thermal_zone)
;; # I don't care, the fan works anyway.
# 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
==========================
Can you spot anything out of place?
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
2007-02-16 19:38 ` Mick
@ 2007-02-16 19:49 ` Raymond Lewis Rebbeck
2007-02-16 20:36 ` Mick
0 siblings, 1 reply; 8+ messages in thread
From: Raymond Lewis Rebbeck @ 2007-02-16 19:49 UTC (permalink / raw
To: gentoo-user
On Saturday, 17 February 2007 6:08, Mick wrote:
> On Friday 16 February 2007 19:13, Raymond Lewis Rebbeck wrote:
> > On Saturday, 17 February 2007 5:31, Mick wrote:
> > > Hi All,
> > >
> > > A few weeks ago I updated acpi and hibernate and their relevant
> > > configuration files. Since then when I press the power button on my
> > > laptop nothing happens.
> > >
> > > Clearly something was changed, intentionally or otherwise, and this
> > > feature is no longer available to me. Would you care to point me in
> > > the right direction - how do I set my power button to run the hibernate
> > > script?
> >
> > I assume you're using acpid. Look in /etc/acpi/ there is a default script
> > that is run for acpi events, it handles the power button by calling
> > /sbin/init 0. Replace the command it runs with hibernate or similar.
>
> Thanks Raymond, I have this in my /etc/acpi/events/default:
> [snip]
>
> Can you spot anything out of place?
Your configs seem to all be in order.
Are you sure that the acpid init script has been started?
Also try checking your logs while pressing the hibernate button and acpid
should output what it is doing and what acpi events it is receiving, you can
view this on vt12.
--
Raymond Lewis Rebbeck
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
2007-02-16 19:49 ` Raymond Lewis Rebbeck
@ 2007-02-16 20:36 ` Mick
[not found] ` <200702170715.41828.dystopianray@gmail.com>
2007-02-16 21:19 ` [gentoo-user] " Alex Schuster
0 siblings, 2 replies; 8+ messages in thread
From: Mick @ 2007-02-16 20:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]
On Friday 16 February 2007 19:49, Raymond Lewis Rebbeck wrote:
> On Saturday, 17 February 2007 6:08, Mick wrote:
> > Can you spot anything out of place?
>
> Your configs seem to all be in order.
>
> Are you sure that the acpid init script has been started?
I am sure it is running alright:
==================================
# rc-update -s -v | grep -i acpid
acpid | default
==================================
> Also try checking your logs while pressing the hibernate button and acpid
> should output what it is doing and what acpi events it is receiving, you
> can view this on vt12.
Thanks. It seems that my syslog-ng is configured different to yours (I guess
some more awful hacking to get xconsole to work is to blame for this) and
nothing relevant to acpid is shown on vt12. However, tail -f /var/log/acpid
showed a couple of errors which I fixed - bar the last one which says:
[Fri Feb 16 20:30:55 2007] BEGIN HANDLER MESSAGES
/etc/acpi/default.sh: line 57: syntax error: unexpected end of file
The last few of lines of my /etc/acpi/default.sh show this much:
==================================
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
==================================
What's your's like?
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
[not found] ` <200702170715.41828.dystopianray@gmail.com>
@ 2007-02-16 20:51 ` Mick
2007-02-16 21:48 ` [gentoo-user] " »Q«
0 siblings, 1 reply; 8+ messages in thread
From: Mick @ 2007-02-16 20:51 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]
On Friday 16 February 2007 20:45, Raymond Lewis Rebbeck wrote:
> On Saturday, 17 February 2007 7:06, Mick wrote:
> > On Friday 16 February 2007 19:49, Raymond Lewis Rebbeck wrote:
> > > On Saturday, 17 February 2007 6:08, Mick wrote:
> > > > Can you spot anything out of place?
> > >
> > > Your configs seem to all be in order.
> > >
> > > Are you sure that the acpid init script has been started?
> >
> > I am sure it is running alright:
> > ==================================
> > # rc-update -s -v | grep -i acpid
> > acpid | default
> > ==================================
> >
> > > Also try checking your logs while pressing the hibernate button and
> > > acpid should output what it is doing and what acpi events it is
> > > receiving, you can view this on vt12.
> >
> > Thanks. It seems that my syslog-ng is configured different to yours (I
> > guess some more awful hacking to get xconsole to work is to blame for
> > this) and nothing relevant to acpid is shown on vt12. However, tail -f
> > /var/log/acpid showed a couple of errors which I fixed - bar the last one
> > which says:
> >
> > [Fri Feb 16 20:30:55 2007] BEGIN HANDLER MESSAGES
> > /etc/acpi/default.sh: line 57: syntax error: unexpected end of file
> >
> > The last few of lines of my /etc/acpi/default.sh show this much:
> > ==================================
> > 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
> > ==================================
> >
> > What's your's like?
>
> I use the default default.sh that comes with acpid. I've only added a
> couple of files to respond to sleep and lid events.
Okey, dokey, what do the default last couple of lines/paras look like?
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] 'Hibernate' by power button
2007-02-16 20:36 ` Mick
[not found] ` <200702170715.41828.dystopianray@gmail.com>
@ 2007-02-16 21:19 ` Alex Schuster
1 sibling, 0 replies; 8+ messages in thread
From: Alex Schuster @ 2007-02-16 21:19 UTC (permalink / raw
To: gentoo-user
Mick writes:
> /etc/acpi/default.sh: line 57: syntax error: unexpected end of file
> The last few of lines of my /etc/acpi/default.sh show this much:
> ==================================
> ac_adapter)
> case "$value" in
> # Add code here to handle when the system is...
> # ;;
>
> # Add code here to handle when the system is...
> # (maybe change cpu scaling to performance mode)
> #*1)
> # ;;
The inner case statement is not closed by an esac. This is missing (yes,
log_unhandled comes twice):
*) log_unhandled $* ;;
esac
;;
> *) log_unhandled $* ;;
> esac
"emerge -1 acpid" should also give you the defaut back. Do a "quickpkg
acpid" before if you changed othr things for yourself you want to keep
(this creates a binary package), you can then emerge it again later
with "emerge -1K acpid".
Alex
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-user] Re: 'Hibernate' by power button
2007-02-16 20:51 ` Mick
@ 2007-02-16 21:48 ` »Q«
0 siblings, 0 replies; 8+ messages in thread
From: »Q« @ 2007-02-16 21:48 UTC (permalink / raw
To: gentoo-user
In <news:200702162051.41541.michaelkintzios@gmail.com>,
Mick <michaelkintzios@gmail.com> wrote:
> > I use the default default.sh that comes with acpid. I've only added
> > a couple of files to respond to sleep and lid events.
>
> Okey, dokey, what do the default last couple of lines/paras look like?
It lives in /usr/portage/sys-power/acpid/files/
I think if I were in your shoes, I'd go back to using the default
default.sh and use separate files for specific events/actions;
hopefully that would avoid this kind of trouble after an update.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-02-16 21:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-16 19:01 [gentoo-user] 'Hibernate' by power button Mick
2007-02-16 19:13 ` Raymond Lewis Rebbeck
2007-02-16 19:38 ` Mick
2007-02-16 19:49 ` Raymond Lewis Rebbeck
2007-02-16 20:36 ` Mick
[not found] ` <200702170715.41828.dystopianray@gmail.com>
2007-02-16 20:51 ` Mick
2007-02-16 21:48 ` [gentoo-user] " »Q«
2007-02-16 21:19 ` [gentoo-user] " Alex Schuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox