I'm having trouble getting a python script and mjpg-streamer to run and stay open in the background. What I have done is to /ect/rc.local
add two lines:
python /home/pi/Desktop/scriptarranque.py
cd mjpg-streamer/mjpg-streamer-experimental/ && ./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so"
When starting, only the first of the two is activated. I'm sure the other one works because if I put it in the terminal it works without problems but I don't know why it doesn't start with the system.
You could add the & character to the end of the first line so that the python script runs in the background and allows it to continue executing the next line in the script.
More information here https://askubuntu.com/a/539293