/etc/systemd/system/myApp.service
[Unit]
Description=My App Service
After=multi-user.target
Wants=multi-user.target
[Service]
ExecStartPre=/bin/sleep 30
Environment="DISPLAY=:0"
ExecStart=/home/pi/startupApp.sh
WorkingDirectory=/home/pi/of_v0.12.0_linuxarmv6l_release/apps/Project/Appname/
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
startupApp.sh
#!/bin/bash
export DISPLAY=:0
cd /home/pi/of_v0.12.0_linuxarmv6l_release/apps/Project/Appname
make run