I have written a python script that communicates with a mysql database. I made it start automaticalliy on boot by creating a launcher.sh file:
#!/bin/sh
#launcher.sh
cd /
cd home/pi/
sudo python ser.py
cd /
and adding
@reboot sh /home/pi/launcher.sh >/home/pi/logs/cronlog 2>&1
to the last line of the crontab by:
sudo crontab -e
when system reboots script tries to start working but it cannot connect to the mysql databse. When I start script by connecting with ssh everything works fine.
How can I start my script on boot automatically after all database services starts?