LinuxQuestions.org
Help answer threads with 0 replies.
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 12-19-2013, 02:22 PM   #1
bl0tt0
Member
 
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 178

Rep: Reputation: 62
lid ACPI actions being run twice on 3.12 kernel


So I've been tooling with upgrading to the 3.12 kernel on my thinkpad T400, and I've discovered that my custom acpi scripts are now being run twice on lid events for some reason. Has anyone else run into this?

Code:
# /etc/acpi/events/lid
event=(button/lid)
action=/etc/acpi/actions/smartsleep.sh %e
Code:
 /etc/acpi/actions/smartsleep.sh:
#!/bin/sh

BAT_DIR=/sys/class/power_supply/BAT0
FULL_BAT=`cat ${BAT_DIR}/energy_full`
CUR_BAT=`cat ${BAT_DIR}/energy_now`
AVG=`expr $(expr ${CUR_BAT} \* 100) / ${FULL_BAT}`

logger "Running smartsleep script"

if grep -q 1 /sys/class/power_supply/AC/online; then
  /etc/acpi/actions/sleep.sh
  exit 0
fi

if [ "$AVG" -le "20" ]; then
  echo suspend > /sys/power/disk
  /etc/acpi/actions/hibernate.sh
  exit 0
else
  /etc/acpi/actions/sleep.sh
fi
Here is the output to /var/log/messages when I close the lid:
Code:
# grep smartsleep /var/log/messages
Dec 19 14:13:03 6h057 logger: Running smartsleep script
Dec 19 14:13:19 6h057 logger: Running smartsleep script
This ACPI configuration works fine with the 3.10 kernel, and I know that they dropped the deprecated /proc/acpi/event interface in 3.12, but I didn't think I was using that anyway.

Last edited by bl0tt0; 12-19-2013 at 02:24 PM.
 
Old 12-19-2013, 02:32 PM   #2
xflow7
Member
 
Registered: May 2004
Distribution: Slackware
Posts: 215

Rep: Reputation: 45
I would have guessed the second invocation is coming when you open the lid back up (which also causes a change of state of the lid switch).
 
Old 12-19-2013, 06:03 PM   #3
bl0tt0
Member
 
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 178

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by xflow7 View Post
I would have guessed the second invocation is coming when you open the lid back up (which also causes a change of state of the lid switch).
By "Bob", you're right! Just added a line to my script to exit if the lid button state is open, and everything's working again! Funny that the issue only showed up with the 3.12 kernel release though...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
eeepc acpi scripts not displaying actions on X kernel-P4N1C Slackware 0 03-05-2012 08:01 PM
Disabling actions on laptop lid close TheStarLion Linux - Laptop and Netbook 3 04-05-2010 05:33 PM
lid.sh acpi event will not run xvattr cmd otkaz Linux - Laptop and Netbook 2 06-19-2009 01:55 PM
Lid Off/On with ACPI alkos333 Slackware 10 05-28-2007 10:26 PM
acpi actions don't trigger events xnomad Linux - Software 0 04-30-2007 10:03 PM

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

All times are GMT -5. The time now is 01:41 PM.

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