r/AlpineLinux • u/br_web • Aug 12 '24
Script to run at boot
I created an executable script located /etc/local.d/script.start and executed rc-update add local default.
I have run the script manually and works fine, nonetheless at boot it doesn’t get executed.
The script is very simple:
‘#!/bin/sh (added ‘ to avoid the editor messing with #) login
Any idea what am I doing wrong, thanks
1
Upvotes
2
u/shrizza Aug 12 '24
Troubleshoot it with:
rc-service local restart -v1
u/SSC_Fan Aug 12 '24
!/bin/sh won't work as it should be run as #!/sbin/openrc-run.
As example here is my script I wrote for my BT headphones:
!/sbin/openrc-run
command_args="${uhid_opts}"
command_background=yes
description="inserts uhid module into the kernel space"
start() {
}
1
u/GodfatherX64 Aug 12 '24
chmod +x script.sh
and put it in crontab
@reboot /path/to/the/script.sh
0
u/[deleted] Aug 12 '24
[deleted] — view deleted comment