Last active
July 22, 2021 14:11
-
-
Save ayu-mushi/8bab917aba49af0ed017b24b1695d950 to your computer and use it in GitHub Desktop.
Ubuntuでsuspendしても自動で復帰してしまうのを抑止する https://dothiko.hatenablog.com/entry/2014/04/23/201923
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Disable devices as wakeup | |
[Service] | |
ExecStart=/usr/local/bin/disable_auto_resume_of_suspend.sh | |
Type=oneshot | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
上URL https://askubuntu.com/questions/152403/how-do-i-make-changes-to-proc-acpi-wakeup-permanent にあるように、systemctlで起動時に実行するようにする
/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
"How do I make changes to /proc/acpi/wakeup permanent?"
https://askubuntu.com/questions/152403/how-do-i-make-changes-to-proc-acpi-wakeup-permanent