summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Component.py1
-rw-r--r--src/lib/Server/Core.py7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 9cdf23b9d..2a3ef20e1 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -76,6 +76,7 @@ def run_component(component_cls, location, daemon, pidfile_name, to_file,
server.serve_forever()
finally:
server.server_close()
+ component.shutdown()
def exposed(func):
"""Mark a method to be exposed publically.
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index e08dd803d..1416f809c 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -153,9 +153,10 @@ class Core(Component):
(plugin), exc_info=1)
def shutdown(self):
- self.terminate.set()
- for plugin in self.plugins.values():
- plugin.shutdown()
+ if not self.terminate.isSet():
+ self.terminate.set()
+ for plugin in self.plugins.values():
+ plugin.shutdown()
def validate_data(self, metadata, data, base_cls):
for plugin in self.plugins.values():