Ubuntu 18.04 wakes immediately from suspend, and will revert this setting back after running echo XHC > /proc/acpi/wakeup.

  • So how can I run this command every time my ThinkPad wakes from suspend?


I've added the following wakeup.sh to be run as a systemd

echo XHC > /proc/acpi/wakeup

and used the service template found here: Execute a network script at wake-up with systemd (15.04)

the service is running but after 1 suspend XHC is enabled again.. is it not being run as sudo? how is this a thing in ubuntu? i just want my thinkpad to stay suspended.

1 Answer 1


since this is posted no where on the internet, i hope this helps someone else

to run a command as su after wakeup create whatever.service in etc/systemd/system

Description=Run user script after suspend
After=basic.target suspend.target hibernate.target


WantedBy=basic.target suspend.target hibernate.target

then in home/you/whatever.sh


your command here


sudo chmod +x /home/you/whatever.sh

then run

systemctl daemon-reload


sudo systemctl enable whatever.service

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.