]> kaliko git repositories - mpd-sima.git/blobdiff - sima/core.py
Catches SIGHUP/SIGUSR1 to trigger conf reload
[mpd-sima.git] / sima / core.py
index 694928fa77815ddd017aab71c4b2c9aadd2a4b78..bf098bbb58ececa7d2442e0927d1009a7ef08e8b 100644 (file)
@@ -16,6 +16,7 @@ from .client import PlayerClient
 from .client import PlayerError, PlayerUnHandledError
 from .lib.simadb import SimaDB
 from .lib.daemon import Daemon
+from .utils.utils import SigHup
 
 class Sima(Daemon):
     """Main class, plugin and player management
@@ -105,6 +106,12 @@ class Sima(Daemon):
             self.log.info('Got reconnected')
             break
 
+    def hup_handler(self, signum, frame):
+        self.log.warning('Caught a sighup!')
+        self.player.disconnect()
+        self.foreach_plugin('shutdown')
+        raise SigHup('SIGHUP caught!')
+
     def shutdown(self):
         """General shutdown method
         """