old_contents: import threading
  import xbmc
  from pulsar.rpc import server_thread
  from pulsar.monitor import PulsarMonitor
  from pulsar.daemon import pulsard_thread
  
  
  def main():
      # Make sure the XBMC jsonrpc server is started.
      xbmc.startServer(xbmc.SERVER_JSONRPCSERVER, True)
  
      # Start the JSONRPC thread
      threading.Thread(target=server_thread).start()
  
      # Start the Pulsard thread
      threading.Thread(target=pulsard_thread).start()
  
      # Get the monitor
      monitor = PulsarMonitor()
  
      # XBMC loop
      while not xbmc.abortRequested:
          xbmc.sleep(1000)
  
      xbmc.log("pulsar: exiting pulsard")
  
new_contents: import threading
  import xbmc
  from pulsar.rpc import server_thread
  from pulsar.monitor import PulsarMonitor
  from pulsar.daemon import pulsard_thread
  
  
  def main():
      # Make sure the XBMC jsonrpc server is started.
      xbmc.startServer(xbmc.SERVER_JSONRPCSERVER, True)
  
      # Start the JSONRPC thread
      threading.Thread(target=server_thread).start()
  
      # Start the Pulsard thread
      threading.Thread(target=pulsard_thread).start()
  
      # Get the monitor
      monitor = PulsarMonitor()
  
      # XBMC loop
      while not xbmc.abortRequested:
          xbmc.sleep(4000)
  
      xbmc.log("pulsar: exiting pulsard")
  
subject: Increase the sleep timeout to 4 seconds to prevent the main thread from quitting