I'm looking for a solution to launch a program when the Raspberry boot, but i need to have an internet connection before launching this program.
I saw few exemple with post-up command in interface file, but it's no more used with Stretch.
How to do this?
Edit: My program is doing a loop continuously after boot. I need waiting the network up, because program need to publish MQTT topic.
Edit2: not working anymore. Service file:
[Unit] Description=mqtt2 Sartup Service After=network-online.target [Service] ExecStart=/home/pi/python3 mqtt2.py [Install] WantedBy=network-online.target
● mqtt2.service - mqtt2 Sartup Service Loaded: loaded (/etc/systemd/system/mqtt2.service; enabled; vendor preset: enabled) Active: inactive (dead)
I've tested with a C-complied program and here with a Python3 script. But if I launch manually the script it's ok