Script doesn't boot when I start my Retropie
-
Best Pie'rs,
I created a script, which works when I run it, but doesn't work when I boot Retropie.
The script looks as following:#!/bin/sh expressvpn connect echo "expressvpn connect"
This script is located in
cd /etc/init.d/expressconnect.sh
I used the following command for my script:sudo chmod +x /etc/init.d/expressconnect.sh
However, when I boot my Raspberry Pi 3 B+, it doesn't seem to work.
Anyone who wants to help this noobie? :)
-
The latest raspian is a Linux distro that uses systemd ... so it would be better to integrate it with that, however installing custom systemd scripts are not for the noobie.
Instead of /etc/init.d, try placing your script into either /etc/rc3.d or /etc/rc5.d ... I don't remember which directory is referenced first for the legacy boot script support. It doesn't hurt to put it in both. You will also need to re-name your script to be prefixed with S and a number, something like S99expressconnect
If the file is executable and starts with #!/bin/bash then no need for the .sh suffix.
I hope this helps
-
@retropier That's not the way to make a script run at boot or make it run as a 'service'. If you follow their (ExpressVPN) install instructions, the package they ask you to install is already providing a service to be run automatically.
After you activate your VPN, try runningsudo systemctl enable expressvpn
and reboot, then check if the VPN service has started automatically. -
@mitu Firstly, I am well aware of the command
expressvpn autoconnect true
. I tried this command and it's set as enabled. Altough when I reboot, it just won't work. I contacted ExpressVPN multiple times, yet nobody who could help me.Also, I followed your instruction:
expressvpn connect
, it connected. Then I typedsudo systemctl enable expressvpn
and rebooted. Still, it is not working for me :( -
@jamesnj Instead of /etc/init.d/, I now put the files (named S99expressconnect), in these dictionaries. But it still won't work :(
I tried so many things... I'm too noob for this -
@retropier Ask the package supplier to provide a correct systemd startup file. They seem to distribute one, but it seems it's not working.
Alternatively, you can add your start-up script in/etc/rc.local
, but make sure the script goes into background, otherwise you'll block the boot process. -
someone asked about this on reddit a few weeks back, and i told them to add it to:
/opt/retropie/configs/all/autostart.shexpressvpn connect &
emulationstation
it seemed to work for them. here's the thread for reference.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.