Skip to content

Instantly share code, notes, and snippets.

@wheeskers
Last active March 13, 2024 11:43
Show Gist options
  • Select an option

  • Save wheeskers/dbd091cc995c7f830889 to your computer and use it in GitHub Desktop.

Select an option

Save wheeskers/dbd091cc995c7f830889 to your computer and use it in GitHub Desktop.
Disable wakeup for device using systemd

Check devices

# cat /proc/acpi/wakeup

Find specific devices

Examples:

EHC1	  S3	*enabled  pci:0000:00:1d.0
EHC2	  S3	*enabled  pci:0000:00:1a.0

Temporary disable waking up for selected device

# echo "EHC1" > /proc/acpi/wakeup
# echo "EHC2" > /proc/acpi/wakeup

Persistent changes via systemd

Create file like this one:

# nano /etc/tmpfiles.d/ehc1-disable-wake.conf

With lines:

w+ /proc/acpi/wakeup - - - - EHC1
w+ /proc/acpi/wakeup - - - - EHC2

Then reboot and check again -- specified devices will not wake up a machine until you let them again.

@HaleTom
Copy link

HaleTom commented Mar 13, 2024

Here's how to do it via sytstemd:
https://unix.stackexchange.com/a/772229/143394

@wheeskers
Copy link
Author

@HaleTom, thanks for the tip! Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment