FS#7593 - acpid update breaks acpi scripts using 'if then fi'
Attached to Project:
Arch Linux
Opened by Shira K (Shirakawasuna) - Tuesday, 10 July 2007, 01:54 GMT
Last edited by Thayer Williams (thayer) - Saturday, 06 December 2008, 21:05 GMT
Opened by Shira K (Shirakawasuna) - Tuesday, 10 July 2007, 01:54 GMT
Last edited by Thayer Williams (thayer) - Saturday, 06 December 2008, 21:05 GMT
|
Details
Description: After upgrading to acpid-1.0.6-1, I noticed
that my laptop would no longer go to sleep upon closing its
lid. After much investigation, it seems that acpid doesn't
like my script in /etc/acpid/actions/lid.sh. This script
*should* work - it works when executed from the cli while
the lid is open and I change grep "closed" to grep "open"
and it works if I use the outputted file from the 'cat' line
and have it 'echo "hello world"'.
If I remove the if-then-fi statements and leave any more basic command, for instance the 'cat' section or adding 'hibernate', the command execute when I close the lid. Downgrading resolves this issue. Additional info: * package version(s) acpid-1.0.6-1 * config and/or log files etc. the lid.sh script: [code] #!/bin/bash # When the display is "being closed", the state is already closed sleep 5 if grep "closed" /proc/acpi/button/lid/LID/state then cat /proc/acpi/button/lid/LID/state >> /home/nick/lid.log fi [/code] Steps to reproduce: create an /etc/acpi/actions script that has an if-then-fi sequence such that you know if it has worked or not, chmod +x it, tie it to an event with an /etc/acpi/events script, restart acpid and cause said event. |
This task depends upon
Closed by Thayer Williams (thayer)
Saturday, 06 December 2008, 21:05 GMT
Reason for closing: Works for me
Saturday, 06 December 2008, 21:05 GMT
Reason for closing: Works for me
This problem is 10 months old.
Is this still valid ? Did you found a solution ?
acpid 1.0.6-1
I have one handler with an if statement that locks my desktop if the display is closed.
This is the behaviour:
* upon boot all other handlers except that one work
** if I do /etc/rc.d/acpid restart, from that point on that handler also works
* I replaced it with a command that gets the status of the lid and writes it to a file, it works after a boot, and lid status is correctly updated upon booting
The test script is about the same:
if grep "open" /proc/acpi/button/lid/LID/status
then
echo "hello" >> /etc/acpi/hello
else
echo "goodbye" >> /etc/acpi/hello
fi
Strangely enough, I get two 'goodbye' messages every time no matter which input I put in and no matter how obvious the 'grep' is. I would chalk this up to it receiving multiple events, but the log says it only gets one :/.
button/lid)
#echo "LID switched!">/dev/tty5
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
echo -n mem >/sys/power/state
fi
;;
This works upon initial startup and subsequent suspend/resumes. Unless I hear otherwise, I'm going to close this ticket.
Any suggestions or explanations about the xlock issue are welcome. For the record I call it like this:
if ...
sudo -u user /usr/bin/xlock
#su - user -c /usr/bin/xlock
fi
I'll close this for now.