From 1e4b0275af0561cba7ca091792d3e2fc8e59dd93 Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Fri, 15 Nov 2013 08:36:18 +0200 Subject: [PATCH] Adds stop_service_on_exit option --- cloudbaseinit/init.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudbaseinit/init.py b/cloudbaseinit/init.py index 2c4a79c3..d6b527c9 100644 --- a/cloudbaseinit/init.py +++ b/cloudbaseinit/init.py @@ -26,6 +26,9 @@ from cloudbaseinit.plugins import factory as plugins_factory opts = [ cfg.BoolOpt('allow_reboot', default=True, help='Allows OS reboots ' 'requested by plugins'), + cfg.BoolOpt('stop_service_on_exit', default=True, help='In case of ' + 'execution as a service, specifies if the service ' + 'must be gracefully stopped before exiting'), ] CONF = cfg.CONF @@ -111,5 +114,5 @@ class InitManager(object): osutils.reboot() except Exception, ex: LOG.error('reboot failed with error \'%s\'' % ex) - else: + elif CONF.stop_service_on_exit: osutils.terminate()