I have had the issue recently that when I suspend the Librem 15v3 (either by pressing the suspend button in the taskbar or by closing the lid), it will automatically wake up after 2 to 5 seconds without any keyboard or mouse click. Worse, sometimes it would freeze and I would have to reboot to be able to use the laptop again.
After some research on the internet, the root cause seems to be some components waking up the laptop. cat /proc/acpi/wakeup
showed that XHCI device was enabled.
Disabling it with echo XHCI | sudo tee /proc/acpi/wakeup
solved the automatic wake up and potential freezing issues.
Where I am stuck is that after rebooting the laptop, the XHCI device is enabled again. So I have to disable it manually through the command line above after every reboot.
Can someone explain the steps to disable a device permanently?
Thanks a lot for sharing the solution! It worked nearly. I cut&pasted the unit file content to my unit file, started, reloaded the config, looked at the status as described and found:
Warning: The unit file, source configuration file or drop-ins of disable-USB-wakeup.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● disable-USB-wakeup.service - Disable USB wakeup triggers in /proc/acpi/wakeup
Loaded: loaded (/etc/systemd/system/disable-USB-wakeup.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-29 09:10:21 CEST; 9s ago
Process: 23430 ExecStart=/bin/sh -c “echo XHCI > /proc/acpi/wakeup” (code=exited, status=127)
Main PID: 23430 (code=exited, status=127)
The problem is the ” - typographic correct, but technically very different from ". I don’t know, why the wrong character showed up in the original description, but the correct unit file should look like this:
[Unit]
Description=Disable USB wakeup triggers in /proc/acpi/wakeup
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo XHCI > /proc/acpi/wakeup"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target