OpenELEC Forum
How do I properly stop Kodi - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: MISCELLANEOUS (https://forum.openelec.tv/forumdisplay.php?fid=23)
+--- Thread: How do I properly stop Kodi (/showthread.php?tid=78780)



How do I properly stop Kodi - Cosmo_Kramer - 11-06-2015

Hello,
After upgrading to OpenElec 6.0, retroarch.sh no longer functions properly when launched from Rom Collection Browser because the script seems to exit after the command:
systemctl stop kodi.service

The logs show:
Nov 06 01:38:20 XBMC systemd[1]: Stopping Kodi Media Center...
Nov 06 01:38:23 XBMC systemd[1]: kodi.service: main process exited, code=exited, status=65/n/a
Nov 06 01:38:23 XBMC systemd[1]: Stopped Kodi Media Center.
Nov 06 01:38:23 XBMC systemd[1]: Unit kodi.service entered failed state.
Nov 06 01:38:23 XBMC systemd[1]: kodi.service failed.

When running these commands from the shell, they seem to work as expected.

Do you guys have any ideas on this?


How do I properly stop Kodi - ultraman - 11-06-2015

Try running some script using systemd-run:
Code:
systemd-run /some_script.sh

There are limitations running scripts from kodi. For example you can't stop kodi and start something else. Because the script will die. That's why you need to use command above.


How do I properly stop Kodi - gark81 - 12-12-2015

Hi ultraman,

Before, with my Openelec's pc x86, i ran Retroarch, and when i launch retroarch.sh, kodi service was freezed or paused, and when i exited from retroarch, kodi service was resumed.

I got this parameters on retroarch.sh's pc:

Code:
pgrep kodi.bin | xargs kill -SIGSTOP
sleep 1
$ADDON_DIR/bin/retroarch -c $ADDON_FILES/config/retroarch.cfg $EXTRAFLAG -L $ADDON_CORES/$1_libretro.so "$2" &
while [ $(pidof retroarch) ];do
usleep 200000
done;
pgrep kodi.bin | xargs kill -SIGCONT

Now, with raspberry pi 2, and retroarch compiled from lakka, retroarch.sh launch retroarch.start,
and retroarch.start stop kodi completely, and then start kodi.

This are last lines from retroarch.start
Code:
systemctl stop kodi
modprobe snd_bcm2835
$ADDON_DIR/bin/retroarch -c $RETROARCH_CONFIG_FILE -L $ADDON_DIR/lib/libretro/$1_libretro.so "$2"
rmmod snd_bcm2835
systemctl start kodi

Is it possible to freeze or pause kodi service, and then resume it?

Because if i launch retroarch from "Advanced Laucher" addon, when i exit from retroarch, it appears on the kodi's main menu, and i need to enter again to "advanced launcher", select the emulator again...