Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
06-05-2011, 10:55 PM
|
#1
|
Member
Registered: Apr 2010
Posts: 197
Rep:
|
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
|
|
|
06-06-2011, 07:38 PM
|
#2
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
The command '/sbin/init 0' shuts down your machine. Hence the following lines are not executed.
Try changing the order.
|
|
|
06-07-2011, 01:49 AM
|
#3
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
Quote:
Originally Posted by allend
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?
|
|
|
06-07-2011, 07:26 AM
|
#4
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
|
|
06-07-2011, 08:16 AM
|
#5
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
Quote:
Originally Posted by allend
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.
|
|
|
06-07-2011, 10:19 AM
|
#6
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
|
|
06-07-2011, 09:33 PM
|
#7
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
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?
|
|
|
06-08-2011, 05:55 AM
|
#8
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
|
|
06-08-2011, 09:29 AM
|
#9
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
Quote:
Originally Posted by allend
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.
|
|
|
06-08-2011, 10:10 AM
|
#10
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
|
|
06-09-2011, 11:37 PM
|
#11
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
Quote:
Originally Posted by allend
|
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
|
|
|
06-10-2011, 04:44 AM
|
#12
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
|
|
06-12-2011, 11:53 PM
|
#13
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
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
|
|
|
06-13-2011, 12:57 AM
|
#14
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,551
|
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.
|
06-19-2011, 08:10 PM
|
#15
|
Member
Registered: Apr 2010
Posts: 197
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 12:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|