Kodi Community Forum

Full Version: Restart kodi script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering if anyone uses a bash or likewise script to restart kodi from a mapped button on their remote when kodi hangs ?

My idea is that I could map it to the power button on my remote and press it when kodi becomes unresponsive, the script would force close kodi and restart it. Would save me having to log into SSH to do it manually.

Anyone doing this and have a script that they would like to share Huh
Those scripts might depend on the distro you run. So I would mention that, too
Good point. Running Ubuntu
and it still might depend which Ubuntu as things have been changed for 14.04.x to 15.04 and will for 16.x

With Ubuntu 15.1 IIRC systemd is introduced to Ubuntu.

So if you are still running Ubuntu 14.04.x LTS the script has to look different to restart a service.
Running whatever kodibuntu is running I guess. Think it's 14.04 ??
It depends how you start Kodi. On one of my machines it's started from an init script. Script tells upstart to respawn the process if it terminates abnormally. Irexec maps a button on my remote to a script which just contains "killall -9 kodi.bin", then upstart re-spawns it.

The init script ( and various other methods of auto-starting kodi on different flavours of Linux) is in the wiki http://kodi.wiki/view/HOW-TO:Autostart_Kodi_for_Linux
sudo service lightdm restart

if this is plain kodibuntu
I'll look into that then and see how I map the power button on my remote to restart kodi. Thanks all