Solved

linux prevent lid close suspend

Posted on 2014-12-23
8
311 Views
Last Modified: 2015-01-01
I have a VIAO VGN-p530H mini netbook running Slackware 14.1, kernel xxx. When I close the lid, the computer hangs. In fact I have to power down to reset. What I want is for nothing to happen when I close the lid; no action.

The link http://slackware.osuosl.org/slackware_source/ap/pm-utils/README.SLACKWARE suggested a script to determine my supported modes:
root@viao:/# for i in hibernate suspend suspend-hybrid ; do
>     pm-is-supported --$i \
>       && echo "$i is supported" \
>       || echo "$i is not supported" ;
>   done
hibernate is supported
suspend is supported
suspend-hybrid is supported

Open in new window

My /var/log/messages from just after closing the lid gives:
/var/log/messages
Dec 24 04:35:05 viao logger: ACPI action lid is not defined

Open in new window

My /etc/acpi/acip_handler.sh has:
#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
         ;;
      *) logger "ACPI action $2 is not defined"
         ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac

Open in new window

and /etc/acpi/events/default is:
# 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

Open in new window

Despite having located these various elements I have little clue as to how to change acpi settings to do what I want, and I haven't found any specific solutions web surfing.
0
Comment
Question by:jmarkfoley
  • 5
  • 3
8 Comments
 
LVL 35

Expert Comment

by:Kimputer
ID: 40516263
Your  /etc/acpi/acip_handler.sh file (along with the log file output) suggest the LID closing action does NOTHING in the system at all (it only displays message, nothing more).
That suggest that your VAIO will react the same say (some lower level BIOS with linux interaction where you have no control over) even if we implement a LID CLOSE function.

Try upgrading EVERYTHING you possibly can (including drivers/optional drivers/kernel/acpid packages)
Are  you using any GUI/Windows manager (X/Gnome/KDE)?
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 40516685
Kimputer: > Your  /etc/acpi/acip_handler.sh file (along with the log file output) suggest the LID closing action does NOTHING in the system at all ... Try upgrading EVERYTHING you possibly can ...

Hmmm, I was afraid of that. In fact, I did upgrade everything already. This poster: http://www.linuxquestions.org/questions/slackware-14/lid-close-lockup-4175522108/#post5254435 found that lid closing didn't work with 14.1 kernels  3.10.17, 3.12.24 and 3.16.4but did work with kernel 3.4.66. Perhaps I should give that a shot? My current version is 3.14.24. How would I locate a specific version kernel like this.

I used to have Ubuntu installed on this same computer, not sure of kernel version, and I recall that closing the lid did not shutdown the computer. So, perhaps a kernel change might work.

What do you think?
0
 
LVL 35

Assisted Solution

by:Kimputer
Kimputer earned 500 total points
ID: 40517557
Actually I was hoping you were using an older kernel, and could update that. Going back to a year old kernel isn't recommended (they're updated for a reason, not for the least, security updates).
So you didn't answer the other question, KDE/Gnome? If so, graphic drivers upgrade could help. Acpid version?
0
 
LVL 1

Accepted Solution

by:
jmarkfoley earned 0 total points
ID: 40517730
I believe I'm using KDE. In fact, I'm using it as I type this. I rarely use X on Linux, but am at the moment. In anticipating your suggestion, I navigated to Application Launcher > System Settings > Power Management, and set 'Button Event Management / when laptop lid closed' to "Do nothing". I'm about to try it now. Will post back results ....
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:jmarkfoley
ID: 40517809
That did the trick? Now, closing the lid has no effect either when running X or at the command line.

Do you have any idea what config file is modified by this tool? Both /etc/acpi/acip_handler.sh and /etc/acpi/events/default are unchanged.
0
 
LVL 35

Expert Comment

by:Kimputer
ID: 40517850
Sadly I don't know exactly. I suspect both the KDE power management as well as acpid responded, and you solved it correctly by setting the option in KDE.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 40520113
Well, it would have been nice to know where this is set as I don't use KDE that often, but I guess I can do so when needed for this setting.
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 40526455
My posting describes the detail of the solution in anticipation of Kimputer's posting. Kimputer's posting led me to the solution.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now