I added a php script to Systemd Services. The script builds a large 2 GB memory database. The problem is that if running the script at startup, only half of the tables are created. Otherwise running the script AFTER startup works fine. I figured out that that problem is that my php script runs before MYSQL server has finished its booting.
So I added a 30 sec delay before my scripts start running. That works, but is there a more professional solution? The script should detect if MYSQL server is already running, and immediately after that should my Systemd Service start.