LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-05-2011, 10:55 PM   #1
narke
Member
 
Registered: Apr 2010
Posts: 197

Rep: Reputation: 5
ACPI does not detect power event?


Hi,


Below is a piece of copy from my /etc/acpi_handler.sh

...
case "$1" in
button)
case "$2" in
power) /sbin/init 0
/usr/bin/date >> /var/log/battery-log 2>&1
/usr/bin/acpitool -B >> /var/log/battery-log 2>&1
;;

*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
;;
...

But I never see the /var/log/battery-log exists in my file system and my laptop was running out of battery and got shutdown abnormally.

Is there something wrong in my acpi_handler.sh script?

-
narke
 
Old 06-06-2011, 07:38 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
The command '/sbin/init 0' shuts down your machine. Hence the following lines are not executed.
Try changing the order.
 
Old 06-07-2011, 01:49 AM   #3
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by allend View Post
The command '/sbin/init 0' shuts down your machine. Hence the following lines are not executed.
Try changing the order.
Sorry for the mistake. Now I switched the order of the statements, but still not seen the 'battery-log' file as expected. I really concerns, did the event button/power happen? Or the event group/name is not correct?
 
Old 06-07-2011, 07:26 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
You say the script is /etc/acpi_handler.sh. Slackware has the default /etc/acpi/acpi_handler.sh.
Also, where did you get the acpitool command? It is not part of standard Slackware.

Last edited by allend; 06-07-2011 at 07:28 AM.
 
Old 06-07-2011, 08:16 AM   #5
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by allend View Post
You say the script is /etc/acpi_handler.sh. Slackware has the default /etc/acpi/acpi_handler.sh.
Also, where did you get the acpitool command? It is not part of standard Slackware.
Yes, it's actually /etc/acpi/acpi_handler.sh. I build acpitool from source tarball because I don't see what utility in slackware can check the battery usage.
 
Old 06-07-2011, 10:19 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Quote:
... I don't see what utility in slackware can check the battery usage.
From the command line you have 'cat /sys/class/power_supply/BAT*/uevent'
KDE has a Battery Monitor widget.
XFCE has the Xfce 4 Power Manager system tray icon.
Windowmaker has a number of dockapps for monitoring the battery.
gkrellm can be configured to monitor the battery and will run in any X session.
 
Old 06-07-2011, 09:33 PM   #7
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
gkrellm is nice! But it is not able to shutdown my computer when battery is low. I see the 'alert commands', but I think I can not depend on it since my gkrellm must run in normal user mode in X where it does not have privilege to shutdown the system.

So, back to the topic: When acpi power events is not triggering?
 
Old 06-08-2011, 05:55 AM   #8
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
What desktop environment or window manager are you running?
Automatic shutdown on low power can be configured in:
KDE using System Settings -> Power Management
XFCE by Settings -> Xfce 4 Power Manager.
 
Old 06-08-2011, 09:29 AM   #9
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by allend View Post
What desktop environment or window manager are you running?
Automatic shutdown on low power can be configured in:
KDE using System Settings -> Power Management
XFCE by Settings -> Xfce 4 Power Manager.
I am using fluxbox. And for the moment, I like to stick to this lightweight window manager.
 
Old 06-08-2011, 10:10 AM   #10
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
I do not use fluxbox, but the suggestion here http://forums.linuxmint.com/viewtopic.php?f=47&t=42501 is to
Quote:
open your ~/.fluxbox/startup file, look for the section for adding startup applications and add this line:
Code:
xfce4-power-manager &
Your user will likely need to be a member of the 'power' group.
 
Old 06-09-2011, 11:37 PM   #11
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by allend View Post
I do not use fluxbox, but the suggestion here http://forums.linuxmint.com/viewtopic.php?f=47&t=42501 is to

Code:
xfce4-power-manager &
Your user will likely need to be a member of the 'power' group.
Hi Allend,

I tried the xfce4-power-manager and found some problems:

1. When run it as non-root user, it's low power action is not configurable and default to do nothing. So how should I start it in fluxbox startup script?
2. 'Hibernate' action does not work. This may not be a fault of xfce4-power-manage. I think I have to enable slackware's hibernate funcationality. But how?

The man page of the program as well as the it's web page don't tell more.

Many thanks & Best Regards,
narke
 
Old 06-10-2011, 04:44 AM   #12
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
I have just started a fluxbox session with the line I gave without the & in my ~/.fluxbox/startup
Code:
# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
## My testing
/usr/bin/xfce4-power-manager
I have no problems with configuring Xfce Power Manager or getting lid switch actions to occur. I have not tested critical battery power events.
 
Old 06-12-2011, 11:53 PM   #13
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Hi, Allend

I am using 0.8.5 xfce4-power-manager on slackware 13.37. Was you using the same version? And, you was running as root or a normal user account?

I did the same configuration to a normal user account. The xfce4-power-manager get runs, but

- The lip actions take no effect. Simply nothing happened if lip closed.
- The On Battery actions are not editable. (right click the xfce4-power-manager icon, and select 'preference', then click 'On Battery').


Best Regards,
narke
 
Old 06-13-2011, 12:57 AM   #14
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Yes, tested with 0.8.5 xfce4-power-manager on slackware 13.37 running as a normal user.

I am starting to think that there is a problem with ACPI on your computer. The inability to get the script to run as well as being unable to successfully use xfce4-power-manager would be consistent with this.
Please test your setup, as root, using the information in /usr/doc/pm-utils-1.4.1/README.SLACKWARE and report the findings together with the make and model of your computer.
 
1 members found this post helpful.
Old 06-19-2011, 08:10 PM   #15
narke
Member
 
Registered: Apr 2010
Posts: 197

Original Poster
Rep: Reputation: 5
Thanks for pointing me to the document /usr/doc/pm-utils-1.4.1/README.SLACKWARE. After I added the user account to the 'power' groups, I found the xfce4-power-manage works, I do suspend my computer after 'lip close' or 'batter low'. Thanks a lot!

But I still don't understand why the 'power' action defined in acpi_handler.sh had never triggered. What's the definition of the event? I think making it works is important when I in console mode where the xfc4-power-manage cannot run.

Hope I can continuous to get help, though the current situation is much better after got help from here.

Cheers,
narke
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Power Issues, vanilla ubuntu kernel, (acpi etc) acpi -V outputs etc jamescondron Linux - Laptop and Netbook 1 02-16-2009 10:48 AM
how to detect system power event(user trigger),suspend,hibernate,resume...? minge.zu Linux - Desktop 1 02-11-2009 08:19 PM
Bypassing ACPI lid button event in X Erratio Linux - Laptop and Netbook 3 10-13-2008 12:12 PM
No acpi battery event on my asus laptop val3xiv Slackware 5 08-27-2008 10:31 AM
lid close generates no acpi event mannyzen76 Linux - Laptop and Netbook 0 02-21-2004 11:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration