SlackwareThis 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.
Yes it is another post concerning lid & standby.
When I do echo -n mem > /sys/power/state in terminal my laptop goes down and when I close and reopen my lid and everything is back and working ok!
I consider this post for help me out to configure the closing part for my lid by what Fluxx posted and I quote:
his lid.sh file
Quote:
#!/bin/sh
# discover video card's ID
ID=`/sbin/lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`
but for me this script do not work properly.
When I close the lid the laptop goes to standby
but when I reopen the lid there is a 1sec on comming back for standby but imadiatly going back to standby therefore I need to repress the power button to bring up from standby.
My question is how do I fix this problem?
Can I add just some lines in the acpi_handler.sh?
#!/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
;;
lid) su dive -c /home/dive/scripts/suspendlock
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
Did not work for me!
Just to make sure, Dive your suspendlock is a .sh file or it is like an event one?
Also
Can it be my lid.sh file that I use (it is posted at the begining)?
I just realise that Fluxx's(that I used) script do not do the resume on an open lid just on a button.
So I thing that is the problem but what script Should I use!!
thank you
Last edited by rssn6; 11-04-2008 at 03:30 PM.
Reason: add stuff
Yes the suspendlock is just a sh file similar to lid.sh. Just put the location of your lid.sh and you can take out the 'su dive -c' part.
Make sure you remove or comment out the lines in your old events file so only one is used at a time though.
If it is still going into suspend right after resuming then it looks like a problem with acpi seeing the lid button event twice. You may want to check your acpi log to see whats happening.
Yes the suspendlock is just a sh file similar to lid.sh. Just put the location of your lid.sh and you can take out the 'su dive -c' part.
Make sure you remove or comment out the lines in your old events file so only one is used at a time though.
If it is still going into suspend right after resuming then it looks like a problem with acpi seeing the lid button event twice. You may want to check your acpi log to see whats happening.
Thank you for the clarification. But what I found very strange is that when I pass echo -n mem > /sys/power/state in the terminal without the lid script then I close the lid and reopen everything goes back to normal.
With the script active when I close or use the terminal command after reopening the lid it goes to standby after a sec of power up.
rssn6: I just managed to achieve the result you described in your first post. I pushed lid fast to down and to up without closing it entirely. If I close it your lid.sh script works well for me.
According to that log acpi_handler.sh isn't running but lid.sh is.
Did you remove the entries from /etc/acpi/events and just use acpi_handler.sh as I put it above? If not, try it. Something like the following:
Code:
#!/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
;;
lid) /etc/acpi/actions/lid.sh
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
Also make sure that lid.sh only contains echo -n mem > /sys/power/state
#!/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
;;
lid) /etc/acpi/lid.sh
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
/bin/sh
# discover video card's ID
##ID=`/sbin/lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`
# securely create a temporary file
##TMP_FILE=`mktemp /tmp/video_state.XXXXXX`
##trap 'rm -f $TMP_FILE' 0 1 15
# switch to virtual terminal 1 to avoid graphics
# corruption in X
##chvt 1
##/sbin/hwclock --systohc
# write all unwritten data (just in case)
##sync
# dump current data from the video card to the
# temporary file
##cat /proc/bus/pci/$ID > $TMP_FILE
# suspend-to-ram
echo -n mem > /sys/power/state
# suspend-to-disk
# echo -n disk > /sys/power/state
##/sbin/hwclock --hctosys
# restore video card data from the temporary file
# on resume
##cat $TMP_FILE > /proc/bus/pci/$ID
# switch back to virtual terminal 7 (running X)
##chvt 7
# remove temporary file
##rm -f $TMP_FILE
with this code when I close my lid it do not go to standby...
ok I corrected the problem, now my laptop goes to standby but open I reopen it goes up and down very quickly, then I press the button and it goes up and then again down... I have to press the button 3 times to bring it up!!!
maybe put and argument for open/close in acpi_handler.sh?
my acpid log
Code:
[Thu Nov 6 09:56:07 2008] BEGIN HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] END HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] action exited with status 0
[Thu Nov 6 09:56:07 2008] completed event "ac_adapter AC 00000080 00000001"
[Thu Nov 6 09:56:07 2008] received event "battery BAT0 00000081 00000001"
[Thu Nov 6 09:56:07 2008] notifying client 2975[82:82]
[Thu Nov 6 09:56:07 2008] notifying client 3066[0:0]
[Thu Nov 6 09:56:07 2008] executing action "/etc/acpi/acpi_handler.sh battery BAT0 00000081 00000001"
[Thu Nov 6 09:56:07 2008] BEGIN HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] END HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] action exited with status 0
[Thu Nov 6 09:56:07 2008] completed event "battery BAT0 00000081 00000001"
[Thu Nov 6 09:56:07 2008] received event "battery BAT0 00000080 00000001"
[Thu Nov 6 09:56:07 2008] notifying client 2975[82:82]
[Thu Nov 6 09:56:07 2008] notifying client 3066[0:0]
[Thu Nov 6 09:56:07 2008] executing action "/etc/acpi/acpi_handler.sh battery BAT0 00000080 00000001"
[Thu Nov 6 09:56:07 2008] BEGIN HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] END HANDLER MESSAGES
[Thu Nov 6 09:56:07 2008] action exited with status 0
[Thu Nov 6 09:56:07 2008] completed event "battery BAT0 00000080 00000001"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.