FS#17995 - [pm-utils] Resume hooks don't work when pm-suspend

Attached to Project: Arch Linux
Opened by Mihail (pevzi) - Monday, 25 January 2010, 05:42 GMT
Last edited by Thayer Williams (thayer) - Wednesday, 14 April 2010, 23:19 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Thayer Williams (thayer)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hooks in /etc/pm/sleep.d/ work only for pm-hibernate, but when resuming from RAM suspending these hooks seem not to launch.

For example, this script launches only when «thawing» but not when resuming:


$ cat /etc/pm/sleep.d/50-hdparm_pm
#!/bin/sh

if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then
hdparm -B 254 /dev/sda > /dev/null
fi


Version of pm-utils is 1.2.6.1-3, kernel 2.6.32.5-1.
This task depends upon

Closed by  Thayer Williams (thayer)
Wednesday, 14 April 2010, 23:19 GMT
Reason for closing:  Not a bug
Comment by Thayer Williams (thayer) - Monday, 25 January 2010, 15:18 GMT
How about something like this (from the pm-utils wikis)...note it uses the bash binary rather than sh:

#!/bin/bash

case $1 in
hibernate)
#echo "Hibernating..."
;;
suspend)
#echo "Suspending..."
;;
thaw)
# reset power management settings for SATA drive
hdparm -B 254 /dev/sda > /dev/null
#echo "Waking from hiberation..."
;;
resume)
# reset power management settings for SATA drive
hdparm -B 254 /dev/sda > /dev/null
#echo "Waking from standby..."
;;
*) echo "Undefined event..."
;;
esac
Comment by Mihail (pevzi) - Monday, 25 January 2010, 15:53 GMT
I tried already the variant with bash, but I tested with someting like this (to know if this script was launched):

...
resume)
touch /home/pevzi/test_file
;;
...

But it seems that after resuming this script doesn't run at all.
Comment by Thayer Williams (thayer) - Tuesday, 16 March 2010, 15:42 GMT
Are you still experiencing this Mihail? I can't reproduce the problem so far and your last example worked fine (creating test_file in the home dir after resume).
Comment by Mihail (pevzi) - Saturday, 20 March 2010, 15:49 GMT
Sorry, I found the point of the problem. I tested suspending using Fn+F2, but it seems that it not uses pm-utils to perform suspending (:

Loading...