Using RPi for OSMC AND as NAS

Continuing the discussion from Sleep/standby wakeup?:

Hey there!
I have been using OSMC on a Raspberry that also hosts a NAS and a small Card/CalDAV server. I hacked together a changed service routine, so the Raspberry can be running but actually turns off the monitor it is connected to.

However, my service routine doesn’t seem to react to the stop call (since it is either waiting for Kodi to terminate or the signal to start Kodi)

The setup with the files is as follows: (

  • the is set as a service called kodi and enabled instead of the mediacenter service
  • when kodi isn’t running irexec waits for key_power signal from the remote, configured in the key_power.irx and nginx is used to host a small website index.php
  • irexec as well as the website (index.php) can send a tcp message to the kodi service to start Kodi.

So far so good, but I would like to have the infinite loop of the process in a way that it can actually be killed. Can anyone help me out with that?

Cheers, Denis