View previous topic :: View next topic |
Author |
Message |
Re-JeeP Apprentice
Joined: 10 Oct 2006 Posts: 294 Location: Sweden
|
Posted: Tue Apr 10, 2007 9:54 am Post subject: [SOLVED] Power management problems |
|
|
Hi!
I have been following this guide to set up power management on my laptop.
I get some trouble at this point:
Quote: | Give it a try: Plug AC in and out and watch syslog for the "Switching to AC mode" or "Switching to battery mode" messages. |
First of all. tail -f /var/log/acpid | grep "received event" gives me:
Quote: | [Tue Apr 10 11:49:26 2007] received event "ac_adapter ACAD 00000080 00000000"
[Tue Apr 10 11:49:29 2007] received event "ac_adapter ACAD 00000080 00000001" |
I have this in my files:
/etc/acpi/events/pmg_ac_adapter
Quote: | event=ac_adapter ACAD 00000080 00000001
action=/etc/acpi/actions/pmg_switch_runlevel.sh %e |
/etc/acpi/events/pmg_battery
Quote: | event=ac_adapter ACAD 00000080 00000000
action=/etc/acpi/actions/pmg_switch_runlevel.sh %e |
/var/log/acpid
Quote: | [Tue Apr 10 11:49:26 2007] received event "ac_adapter ACAD 00000080 00000000"
[Tue Apr 10 11:49:26 2007] executing action "/etc/acpi/actions/pmg_switch_runlevel.sh ac_adapter ACAD 00000080 00000000"
[Tue Apr 10 11:49:26 2007] BEGIN HANDLER MESSAGES
[Tue Apr 10 11:49:28 2007] END HANDLER MESSAGES
[Tue Apr 10 11:49:28 2007] action exited with status 0
[Tue Apr 10 11:49:28 2007] completed event "ac_adapter ACAD 00000080 00000000"
[Tue Apr 10 11:49:29 2007] received event "ac_adapter ACAD 00000080 00000001"
[Tue Apr 10 11:49:29 2007] executing action "/etc/acpi/actions/pmg_switch_runlevel.sh ac_adapter ACAD 00000080 00000001"
[Tue Apr 10 11:49:29 2007] BEGIN HANDLER MESSAGES
[Tue Apr 10 11:49:30 2007] END HANDLER MESSAGES
[Tue Apr 10 11:49:30 2007] action exited with status 0
[Tue Apr 10 11:49:30 2007] completed event "ac_adapter ACAD 00000080 00000001" |
I'm missing the lines "Switching to AC mode" and "Switching to battery mode"...
Any ideas? _________________ Dig where you stand!
Last edited by Re-JeeP on Tue Apr 10, 2007 11:15 am; edited 1 time in total |
|
Back to top |
|
|
Ehnvis Guru
Joined: 13 Jun 2006 Posts: 305 Location: /dev/random
|
Posted: Tue Apr 10, 2007 10:26 am Post subject: |
|
|
Can you paste your /etc/acpi/actions/pmg_switch_runlevel.sh ? _________________ HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine. |
|
Back to top |
|
|
Re-JeeP Apprentice
Joined: 10 Oct 2006 Posts: 294 Location: Sweden
|
Posted: Tue Apr 10, 2007 10:45 am Post subject: |
|
|
Ehnvis wrote: | Can you paste your /etc/acpi/actions/pmg_switch_runlevel.sh ? |
It's the one from the guide!
Code: | #!/bin/bash
# BEGIN configuration
RUNLEVEL_AC="default"
RUNLEVEL_BATTERY="battery"
# END configuration
if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]
then
logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
exit 1
fi
if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]
then
logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting."
exit 1
fi
if on_ac_power
then
if [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]]
then
logger "Switching to ${RUNLEVEL_AC} runlevel"
/sbin/rc ${RUNLEVEL_AC}
fi
elif [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]]
then
logger "Switching to ${RUNLEVEL_BATTERY} runlevel"
/sbin/rc ${RUNLEVEL_BATTERY}
fi |
_________________ Dig where you stand! |
|
Back to top |
|
|
Ehnvis Guru
Joined: 13 Jun 2006 Posts: 305 Location: /dev/random
|
Posted: Tue Apr 10, 2007 10:52 am Post subject: |
|
|
Have you changed so the file can be executed? Code: | chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh |
_________________ HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine. |
|
Back to top |
|
|
Re-JeeP Apprentice
Joined: 10 Oct 2006 Posts: 294 Location: Sweden
|
Posted: Tue Apr 10, 2007 10:54 am Post subject: |
|
|
Ehnvis wrote: | Have you changed so the file can be executed? Code: | chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh |
|
Yepp!
ls -l /etc/acpi/actions/pmg_switch_runlevel.sh
Quote: | -rwxr-xr-x 1 root root 734 Apr 10 11:06 /etc/acpi/actions/pmg_switch_runlevel.sh |
_________________ Dig where you stand! |
|
Back to top |
|
|
Re-JeeP Apprentice
Joined: 10 Oct 2006 Posts: 294 Location: Sweden
|
Posted: Tue Apr 10, 2007 11:15 am Post subject: |
|
|
I solved it!
The log file was /var/log/messages and not /var/log/acpid. _________________ Dig where you stand! |
|
Back to top |
|
|
Ehnvis Guru
Joined: 13 Jun 2006 Posts: 305 Location: /dev/random
|
Posted: Tue Apr 10, 2007 11:30 am Post subject: |
|
|
Oh bloody hell, I should have thought of that as I had the same problem. I did check in the wrong logfile too
when I did set this up. Ah well, glad you found it. _________________ HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine. |
|
Back to top |
|
|
Re-JeeP Apprentice
Joined: 10 Oct 2006 Posts: 294 Location: Sweden
|
Posted: Tue Apr 10, 2007 11:51 am Post subject: |
|
|
Ehnvis wrote: | Oh bloody hell, I should have thought of that as I had the same problem. I did check in the wrong logfile too
when I did set this up. Ah well, glad you found it. |
I emailed the person who did the documentation and suggested to be more specifik. _________________ Dig where you stand! |
|
Back to top |
|
|
|