Thanks @gouchi!
So, I’ll check the status every 0.5 seconds and then if it has stopped, then stop it (to stop auto restart).
Then do the reboot.
I looked for a systemctl command that could disable the restart systemd option but doesn’t seem to be way.
Maybe a better way is to use a drop-in.
/storage/.config/system.d/retroarch.service.d/10-restart-to-kodi.conf
[Service]
Restart=on-failure
ExecStopPost=/bin/bash -c '[ $SERVICE_RESULT = "success" ] && reboot {kodi_partition}'
That should also remove the current unwanted behavior of it rebooting if retroarch crashes for some reason.
I just tried this and it works beautifully.
I will update my add-on to use this method instead of the current autostart.sh method
@Sylvester
I think you’ll need to start from scratch. NOOBS / PINN doesn’t allow simply re-installing one system. You need to reinstall them all. If you boot into KODI, you can make a backup. KODI should also mount the storage partition from Lakka. So, via KODI - you could make a backup of your Lakka settings.