5

I disabled most of my entries in /proc/acpi/wakeup/ to make sure only the power button and the laptop lid can resume my system, not the mouse or keyboard. The problem is: every time I reboot, the settings are reset for some reason.

Is there a way to make these changes permanent? There are some workaround out there that just put the commands into a script hooked to some wakeup routine, but is there really no other solution?

I'm using a Debian/Gnome Windows 10 dual boot laptop

  • Can you set it in the bios? Or uefi as it probably is now.. – Guy Jan 19 '18 at 12:49
  • Nope I checked all my BIOS settings and found nothing helpful there – piegames Jan 19 '18 at 14:44
-1

The /proc is a virtual file system containing runtime system info. So its content resets on reboot.

To make the kernel/system settings persistent across reboots you can employ the sysctl. There are corresponding sysctl settings to the /proc ones.

So basically, you need to transform and put all your /proc/acpi/wakeup settings to the /etc/sysctl.conf file. This way they get loaded at boot. There is a HowTo guide.

  • So, how exactly do I set OHC1 to disabled in /proc/acpi/wakeup? – piegames Jan 18 '18 at 9:34
  • Sorry, @piegames, this seems to require a script triggered on startup (in your case via systemd). The script really just needs to echo the values to /proc/acpi/wakeup. This should give you the idea: linuxconfig.org/… – Yuri Jan 18 '18 at 20:48
  • The systemd service unit running a script did the job for me. Please update your answer so that it also works without the links. – piegames Jan 23 '18 at 22:41
  • Okay it does not work completely: although the script works fine, changes to EHC3 (the one with my mouse on it) does not work when calling the script. I still need to call the command manually as su. – piegames Jan 24 '18 at 13:35
  • 6
    /proc/acpi/wakeup is not a child of /proc/sys, sysctl doesn't work here. – Erik Feb 12 '19 at 19:50
1

acpitool can be used for this apt install acpitool

And then sudo acpitool -W [some number]

where some number is device id from /proc/acpi/wakeup

maciej@michal:~$ sudo acpitool -W 22
  Changed status for wakeup device #22 (UHC6)

   Device   S-state   Status   Sysfs node
  ---------------------------------------
  1. PCE2     S4    *disabled  pci:0000:00:02.0
  2. PCE3     S4    *disabled
  3. PCE4     S4    *disabled  pci:0000:00:04.0
  4. RLAN     S4    *enabled   pci:0000:02:00.0
  5. PCE5     S4    *disabled
  6. PCE6     S4    *disabled
  7. PCE7     S4    *disabled  pci:0000:00:07.0
  8. PCE9     S4    *disabled
  9. PCEA     S4    *disabled
  10. PCEB    S4    *disabled
  11. PCEC    S4    *disabled
  12. SBAZ    S4    *disabled  pci:0000:00:14.2
  13. PS2K    S4    *disabled
  14. PS2M    S4    *disabled
  15. UAR1    S4    *disabled  pnp:00:03
  16. P0PC    S4    *disabled  pci:0000:00:14.4
  17. UHC1    S4    *disabled  pci:0000:00:12.0
  18. UHC2    S4    *disabled  pci:0000:00:12.1
  19. UHC3    S4    *disabled  pci:0000:00:12.2
  20. USB4    S4    *disabled  pci:0000:00:13.0
  21. UHC5    S4    *disabled  pci:0000:00:13.1
  22. UHC6    S4    *disabled  pci:0000:00:13.2
  23. UHC7    S4    *enabled   pci:0000:00:14.5
  • 1
    It was asked for a permanent solution. This one is only temporary. – Matthias Lohr Jun 1 '19 at 10:36
0

Eric Garrido has a script in /etc/rc.local that echo's those devices that are allowed to wake up his system, to /proc/acpi/wakeup.

for i in `/bin/grep USB /proc/acpi/wakeup | /usr/bin/awk '{print $1}'`; 
do 
    echo $i > /proc/acpi/wakeup; 
done
0

For a USB mouse or keyboard, you can use a udev rule to make the setting permanent. First, look up the PCI vendor ID of your mouse/keyboard using lsusb. For my mouse, it's 046d:

Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver

Then create a "rules" file like my /etc/udev/rules.d/logitech.rules, only replace "046d" with the vendor ID of your own device:

ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTR{power/wakeup}="disabled"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.