You are not logged in.
Hi,
I need the computer to shut down on hibernate (via systemd).
By "shut down" I mean that the computer should not wake up on any other action than Power Button press or a WoL magic packet.
Currently when I hibernate (via systemctl hibernate or clicking on Hibernate in XFCE) the compuer shuts down but powers on on a keyboard press or a mouse click. I don't want that.
I've been ddg'ing around and found /sys/power/disk but "echo shutdown > /sys/power/disk" doesn't seem to have the desired effect. Didn't find anything useful on systemd itself.
When I do a "real" shutdown (i.e. run poweroff or click shutdown in xfce) I get the expected behavior.
Any tips on what I should look into?
thanks,
-miky
What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...
... and who is general Failure and why is he reading my harddisk?
Offline
Two things to look into: /proc/acpi/wakeup and /sys/devices/.../power/wakeup. You could disable wakeup on devices before hibernating and enable it after thawing (man systemd-sleep).
Offline
Also check your BIOS, I know mine has an option to enable/disable resume from keyboard.
Offline
AS lucke suggests, check /proc/acpi/wakeup. I.e. on my system there is XHC device with enabled status which is causing wake up from keyboard and mouse.
You can switch state with simple
echo XHC > /proc/acpi/wakeup
If you suspend system and it works, you just need to do this before every sleep. You can use systemd hook (beware that on some systems hooks are in /usr/lib/systemd/system-sleep and on some systems in /lib/systemd/system-sleep. Just check man systemd-suspend.service for correct path):
#!/bin/bash
# /lib/systemd/system-sleep/45fix-usb-wakup
# Disable wakup from USB devices
#
# This is just modified version of pm-utils script from
# https://gist.github.com/rutsky/1ed8e9779f0b2941c5a6
[[ "$1" = "pre" ]] || exit 0
function print_state {
cat /proc/acpi/wakeup | grep $1 | cut -f3 | cut -d' ' -f1 | tr -d '*'
}
function disable_wakup {
dev=$1
if [ "`print_state $dev`" == "enabled" ]; then
echo $dev > /proc/acpi/wakeup
fi
}
function enable_wakup {
dev=$1
if [ "`print_state $dev`" == "disabled" ]; then
echo $dev > /proc/acpi/wakeup
fi
}
case $2 in
suspend)
echo "Fixing acpi settings."
# Disable wakup by events from USB hubs
# (e.g. mouse move on some mices)
disable_wakup XHC
;;
esac
Offline