[Unit]
Description=Kodi Media Center
After=network-online.target graphical.target
Requires=graphical.target
Wants=network-online.target

[Service]
EnvironmentFile=/usr/lib/kodi/kodi.conf
EnvironmentFile=-/run/libreelec/kodi.conf
EnvironmentFile=-/run/libreelec/debug/kodi.conf
ExecStartPre=-/usr/lib/kodi/kodi-config
ExecStart=/usr/lib/kodi/kodi.sh --standalone -fs $KODI_AUDIO_ARGS $KODI_ARGS $KODI_DEBUG
ExecStop=/bin/kill -TERM $MAINPID
ExecStopPost=-/usr/lib/kodi/kodi-safe-mode
TimeoutStopSec=30
Restart=always
RestartSec=2
StartLimitInterval=0
LimitNOFILE=16384

[Install]
WantedBy=kodi.target
