Restart Kodi from kodi

  • Hello,

    I know that to restart kodi from ssh, you have to use following command :

    systemctl restart kodi

    I would like to be able to trigger such a command from kodi but I did not manage to do it.

    1st Try : Trigger a pyton script from /storage/.kodi/userdata/keymaps/remote.xml

    Python script :

    import xbmc, xbmcgui

    xbmc.executebuiltin('System.Exec(systemctl restart kodi)')

    => It does not work

    2nd Try : Trigger a .sh script from /storage/.kodi/userdata/keymaps/remote.xml

    And .sh file is :

    systemctl restart kodi

    It does not work neither.

    Does anyone know how to make it work?

  • Try putting restart command

    Code
    systemctl restart kodi

    in some shell script (for example /storage/restart_kodi.sh)

    and then restart kodi from kodi itself with command

    Code
    systemd-run /storage/restart_kodi.sh

    Maybe there is some better solution.


    In keyboard.xml it needs to be used like

    Code
    <some_key>System.Exec("systemd-run,/storage/restart_kodi.sh")</some_key>
  • i suspect you're trying to restart as the kodi instance is stopping. I see the same behaviour if I kill kodi and quickly restart it.

    Maybe fork a script that waits for the kodi process to finish and then restarts it?