[Unit] Description=Retroarch After=graphical.target ConditionKernelCommandLine=!retroarch=0 Requires=graphical.target [Service] Environment=HOME=/storage DISPLAY=:0 #EnvironmentFile=-/run/libreelec/retroarch.conf EnvironmentFile=-/storage/.cache/services/retroarch.conf ExecStartPre=-/usr/lib/retroarch/retroarch-config ExecStart=/usr/bin/retroarch # keep KillMode=process unless there is no good reason to switch to cgroup KillMode=process TimeoutStopSec=300 Restart=always RestartSec=2 StartLimitInterval=0 [Install] WantedBy=retroarch.target