[Kimchi-devel] [PATCH] Bug fix #529: Kill all Kimchi process when stopping kimchid service

Aline Manera alinefm at linux.vnet.ibm.com
Tue Dec 9 16:49:22 UTC 2014


When using "tree.mount(); engine.start(); engine.block()" to start cherrypy
server, we need to manually subscribe to the signal handlers plugin.

For reference: https://cherrypy.readthedocs.org/en/3.2.6/refman/process/plugins/signalhandler.html

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/server.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index ec78b6c..eb58465 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -172,6 +172,10 @@ class Server(object):
             cherrypy.tree.mount(plugin_app, script_name, plugin_config)
 
     def start(self):
+        # Subscribe to SignalHandler plugin
+        if hasattr(cherrypy.engine, 'signal_handler'):
+            cherrypy.engine.signal_handler.subscribe()
+
         cherrypy.engine.start()
         cherrypy.engine.block()
 
-- 
1.9.3




More information about the Kimchi-devel mailing list