Hello, I need to add two commands at boot, but root permissions are needed.
I have the /usr/bin/vpn-unlimited-daemon and the /usr/bin/preload. In which way can I add them at boot? My desktop environment is plasma, and the init service is runit.
All our inits are made to execute script files in /etc/local.d, *.start at boot and *.stop at shutdown. See https://wiki.artixlinux.org/Main/OpenRC#rc.local for more information.
i created two files in /etc/local.d
sudo touch /etc/local.d/preload.start
sudo nano /etc/local.d/preload.start
#!/bin/sh
# Start preload service
sudo /usr/bin/preload &
and the second file
sudo touch /etc/local.d/vpn.start
sudo nano /etc/local.d/vpn.start
#!/bin/sh
# Start Vpn-Unlimited service
sudo /usr/bin/vpn-unlimited-daemon &
but unfortunately, none of them start
can you help me more?
Have you made them executable ?
eg
sudo chmod +x /etc/local.d/preload.start
Also, no need for sudo because those scripts are run as root.
Also, backgrounding processes may cause the second to fail if it depends on the first and the first hasn't initialized yet. If I were you,I'd put them both in one script and place a 'sleep 3' between them.
now I created the below script
GNU nano 7.2 /etc/local.d/vpn.start
#!/bin/sh
# Start Vpn-Unlimited and preload service
sudo /usr/bin/vpn-unlimited-daemon &
sleep 3
sudo /usr/bin/preload &
chmod +x, and it seems ok!
ps, I am not sure about preload, but VPN running!
Next!