v18 How to quit kodi from a script on raspbian
#1
I have a question regarding a script call to
python:
xbmc.executebuiltin('Quit')
When I call this function from within a script, kodi is automatically restarted on raspbian (buster). Kodi is started as a user process on reboot, I added a user autostart entry according to this stackexchange question.
I also tried quitting kodi by killing the processes running it, but that also just lead to a restart of kodi. I used a script which gets invoked via subprocess.Popen with kill commands for the binary as well as the launcher script
bash:
kill -9 $KODI_BIN_PID
kill -9 $KODI_LAUNCHER_PID
Do you know why kodi is restarted automatically when it is killed/quit on raspbian? How could I prevent it from starting?
If kodi is not running anymore, will a bash script that was started by Popen from my script also be terminated or will it continue running?

The ideal solution to my problem would be to simply have a working command that minimizes kodi on raspbian, but
python:
xbmc.executebuiltin('Minimize')
has absolutely no effect on that platform.
Reply
#2
(2021-11-07, 18:33)BdN3504 Wrote: I have a question regarding a script call to
python:
xbmc.executebuiltin('Quit')
When I call this function from within a script, kodi is automatically restarted on raspbian (buster). Kodi is started as a user process on reboot, I added a user autostart entry according to this stackexchange question.
I also tried quitting kodi by killing the processes running it, but that also just lead to a restart of kodi. I used a script which gets invoked via subprocess.Popen with kill commands for the binary as well as the launcher script
bash:
kill -9 $KODI_BIN_PID
kill -9 $KODI_LAUNCHER_PID
Do you know why kodi is restarted automatically when it is killed/quit on raspbian? How could I prevent it from starting?
If kodi is not running anymore, will a bash script that was started by Popen from my script also be terminated or will it continue running?

The ideal solution to my problem would be to simply have a working command that minimizes kodi on raspbian, but
python:
xbmc.executebuiltin('Minimize')
has absolutely no effect on that platform.

Seems like I'm only having conversations with myself. Anyway, if anyone else wonders why kodi keeps restarting, this is the answer:
https://wiki.lxde.org/en/LXSession#autos...ation_file
Putting a '@' sign in front of commands to be autostarted makes them restart automatically.
Reply
#3
Try executing "systemctl stop kodi" with subprocess or os.system. On libreelec kodi is spawn through system service, therefore if you manually kill the process it is spawn again by the service. Better info should be available on raspian sites.
Reply

Logout Mark Read Team Forum Stats Members Help
How to quit kodi from a script on raspbian0