Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] How to autorun at boot a non runit daemon (Read 481 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

[SOLVED] How to autorun at boot a non runit daemon

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.


Re: How to autorun at boot a non runit daemon

Reply #2
i created two files in /etc/local.d

Code: [Select]
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
Code: [Select]
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?

Re: How to autorun at boot a non runit daemon

Reply #3
Have you made them executable ?
eg
Code: [Select]
sudo chmod +x /etc/local.d/preload.start


Re: How to autorun at boot a non runit daemon

Reply #5
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.

Re: How to autorun at boot a non runit daemon

Reply #6
now I created the below script
Code: [Select]
    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!