for some reason my machine has problems with suspension, specifically, it resumes as soon as it suspends. After some research I was able to solve this problem on 14.04 by using the following loop, as per this answer: https://askubuntu.com/a/268172
#!/bin/bash
case $1 in
hibernate)
echo "Going to suspend to disk!"
;;
suspend)
echo "Fixing acpi settings."
for usb in 'XHC' 'EHC1' 'EHC2';
do
state=`cat /proc/acpi/wakeup | grep $usb | cut -f3 | cut -d' ' -f1 | tr -d '*'`
echo "device = $usb, state = $state"
if [ "$state" == "enabled" ]
then
echo $usb > /proc/acpi/wakeup
fi
done
echo "Suspending to RAM."
;;
thaw)
echo "Suspend to disk is now over!"
;;
resume)
echo "We are now resuming."
;;
*)
echo "Somebody is callin me totally wrong."
;;
esac
However with the new systemd this solution isnt working anymore, I managed to create and place the same script on /usr/lib/systemd/system-sleep/, however this doesnt work as it doesnt execute, here is the output of my journal:
may 22 22:59:43 waiobook systemd[1]: Starting Suspend...
may 22 22:59:43 waiobook systemd-sleep[1372]: Suspending system...
may 22 22:59:49 waiobook systemd-sleep[1372]: System resumed.
may 22 22:59:49 waiobook systemd[1]: Started Suspend.
may 22 20:09:03 waiobook systemd[1]: Starting Suspend...
may 22 20:09:03 waiobook systemd-sleep[2674]: Suspending system...
may 22 20:09:07 waiobook systemd-sleep[2674]: System resumed.
may 22 20:09:07 waiobook systemd[1]: Started Suspend.
So i'm guessing im doing something wrong with the script?
Any help is aprecciated.