You are not logged in.
Hello, I want the following command to run at system startup:
echo XHC1 > /proc/acpi/wakeup
I have a sysvinit initialisation system. As far as I understand I need to create a script and place it in /etc/init.d/ then run sudo update-rc.d 'service name' defaults. I created a simple bash script:
#!/bin/bash
echo XHC1 > /proc/acpi/wakeup
but it seems that I am doing something wrong since the update-rc.d command shows error when I add the script to default run level, and the script doesn't execute for some reason.
Best regards
P.S
As far as I understand the script should be compliant to some sysvinit syntax, but I can't figure what are the exact rules.
Last edited by xsR_head (2021-08-31 21:19:44)
Offline
You use SysVinit, but issue commands for OpenRC? Best read up on boot scripts for sysvinit then Also, it's best practice to end a script with
exit 0
HTH!
Offline
I am pretty sure you are confusing sysvinit update-rc.d with OpenRC rc-update.
P.S I previously used OpenRC on Artix
Last edited by xsR_head (2021-08-31 21:20:51)
Offline
Aight, I think I figured it out, looking at other scripts. Gonna mark the question as [SOLVED] when done.
Offline
Aight, here is the script (I used manual for 'init-d-script' for syntax man init-d-script):
#!/bin/bash
### BEGIN INIT INFO
# Provides: dead_XHC1
# Required-Start: $all
# Required-Stop:
# Default-Start: 2
# Default-Stop:
# Short-Description: Disable wake on XHC1
# Description: Disable wake on XHC1
#
### END INIT INFO
echo XHC1 > /proc/acpi/wakeup
exit 0
Then I made it executable
chmod +x /etc/init.d/dead_XHC1
Then added to the service list
sudo update-rc.d 'dead_XHC1' defaults
P.S:
Btw, this script fixes not properly working suspend on lid close for certain laptops that have issue with brcfmac driver.
You might want to play around with what device you need to disable; The enabled devices available at:
cat /proc/acpi/wakeup
Hope this will help someone, coz I spend days trying to figure out what's wrong with suspend.
Last edited by xsR_head (2021-08-31 22:57:50)
Offline
I would just stick it in /etc/rc.local. I do a similar thing to defeat the power-saving on my sound card, which makes nasty pops:
#!/bin/bash
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
exit 0
Offline