LinuxQuestions.org
Review your favorite Linux distribution.
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 05-22-2020, 05:55 AM   #1
przemo
Member
 
Registered: Feb 2016
Location: cork.ie
Distribution: Slackware-current
Posts: 149

Rep: Reputation: Disabled
Acpi events


cannot set suspend on t430 laptop LID closing

pm-suspend command is working
echo -n "mem" > /sys/power/state is working too

Code:
ls /etc/acpi/
acpi_handler.sh  events

ls -al /etc/acpi/events/
total 20
drwxr-xr-x 2 root root 4096 May 21 22:58 .
drwxr-xr-x 3 root root 4096 May 19 10:28 ..
-rw-r--r-- 1 root root   49 May 21 18:40 LID
-rw-r--r-- 1 root root  635 Aug 21  2019 default
-rwxr-xr-x 1 root root  546 May 21 22:58 sleep.sh
Code:
cat /etc/acpi/events/LID 
event=button/lid
action=/etc/acpi/sleep.sh "%e" 

cat /etc/acpi/sleep.sh
echo -n "mem" > /sys/power/state

cat /etc/acpi/events/default 
# This is the ACPID default configuration, it takes all
# events and passes them to /etc/acpi/default.sh for further
# processing.

# event keeps a regular expression matching the event. To get
# power events only, just use something like "event=button power.*"
# to catch it.
# action keeps the command to be executed after an event occurs
# In case of the power event above, your entry may look this way:
#event=button power.*
#action=/sbin/init 0

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

event=.*
action=/etc/acpi/acpi_handler.sh %e
 
Old 05-22-2020, 06:44 AM   #2
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware current 64bit
Posts: 967
Blog Entries: 5

Rep: Reputation: 181Reputation: 181
Where is stored file sleep.sh?
In your first code quote it says
Code:
ls -al /etc/acpi/events/
total 20
drwxr-xr-x 2 root root 4096 May 21 22:58 .
drwxr-xr-x 3 root root 4096 May 19 10:28 ..
-rw-r--r-- 1 root root   49 May 21 18:40 LID
-rw-r--r-- 1 root root  635 Aug 21  2019 default
-rwxr-xr-x 1 root root  546 May 21 22:58 sleep.sh
Then in the second quote:

Code:
cat /etc/acpi/sleep.sh
echo -n "mem" > /sys/power/state
It should be stored in /etc/acpi and not /etc/acpi/events

Last edited by gegechris99; 05-22-2020 at 06:45 AM. Reason: typo
 
Old 05-22-2020, 08:25 AM   #3
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware current 64bit
Posts: 967
Blog Entries: 5

Rep: Reputation: 181Reputation: 181
Also, I would add a * character at the end of event line in /etc/acpi/events/LID
Code:
cat /etc/acpi/events/LID 
event=button/lid*
action=/etc/acpi/sleep.sh "%e"
 
Old 05-22-2020, 09:13 AM   #4
przemo
Member
 
Registered: Feb 2016
Location: cork.ie
Distribution: Slackware-current
Posts: 149

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gegechris99 View Post
Also, I would add a * character at the end of event line in /etc/acpi/events/LID
Code:
cat /etc/acpi/events/LID 
event=button/lid*
action=/etc/acpi/sleep.sh "%e"

bang on, problem solved
 
  


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
user space profiling events enable parameter behaviour not clear: /sys/kernel/debug/tracing/events/enable reset to X when set to 1 barz_83_LQ Linux - Kernel 1 11-30-2017 07:28 AM
ACPI events in /etc/acpi/events alienDog Ubuntu 0 12-22-2010 06:30 PM
Keyboard events interrupting mouse events. miner49er Linux - Hardware 3 11-04-2008 04:16 AM
Hang on triggering udev events- is there a buildup of events? sonichedgehog Slackware 20 07-11-2008 02:49 AM
acpi events? raven Linux - Laptop and Netbook 2 10-12-2003 02:23 PM

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

All times are GMT -5. The time now is 12:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration