Skip to content

Instantly share code, notes, and snippets.

@ayu-mushi
Last active July 22, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayu-mushi/8bab917aba49af0ed017b24b1695d950 to your computer and use it in GitHub Desktop.
Save ayu-mushi/8bab917aba49af0ed017b24b1695d950 to your computer and use it in GitHub Desktop.
Ubuntuでsuspendしても自動で復帰してしまうのを抑止する https://dothiko.hatenablog.com/entry/2014/04/23/201923
[Unit]
Description=Disable devices as wakeup
[Service]
ExecStart=/usr/local/bin/disable_auto_resume_of_suspend.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
#!/bin/bash
WAKEUPS=$(cat /proc/acpi/wakeup | grep enabled | awk '{ print $4 }' | sed -e "s/pci:\(.[^:]\)/\1/g")
for w in $WAKEUPS
do
echo $w
echo 'disabled' > /sys/bus/pci/devices/$w/power/wakeup
done
@ayu-mushi
Copy link
Author

ayu-mushi commented Jul 8, 2021

@ayu-mushi
Copy link
Author

上URL https://askubuntu.com/questions/152403/how-do-i-make-changes-to-proc-acpi-wakeup-permanent にあるように、systemctlで起動時に実行するようにする

@ayu-mushi
Copy link
Author

/etc/systemd/system/にdisable-device-as-wakeup.serviceを置いてsystemctl enable disable-device-as-wakeup.service

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