0

I use /etc/rc.local to autostart two services.

sh /home/ubuntu/osrm.sh || /bin/true
sh /home/ubuntu/photon.sh || /bin/true

|| /bin/true is used to ensure that it always succeeds even if the shell script fails.

My problem is that, only the first command executes. It also has to be noted that both scripts run services that keep running (i.e. webservices)

  • Subsequent commands only run once the the first one has completed. You probably want to modify the osrm.sh script to a proper startup script that starts/runs the actual service in the background so it completes once the service is up and running, rather than a script that keeps running for as long as the service is up and running. – HBruijn Mar 7 '16 at 9:46
0

Ok it seems that the following works:

nohup /home/ubuntu/osrm.sh &
nohup /home/ubuntu/photon.sh &
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.