diff --git a/base/server/python/pki/server/deployment/scriptlets/configuration.py b/base/server/python/pki/server/deployment/scriptlets/configuration.py index 06340f3de1f..b733db5a0bd 100644 --- a/base/server/python/pki/server/deployment/scriptlets/configuration.py +++ b/base/server/python/pki/server/deployment/scriptlets/configuration.py @@ -268,14 +268,21 @@ def spawn(self, deployer): instance.set_sslserver_cert_nickname(nickname, token) else: - logger.info('Starting %s subsystem', subsystem.type) - subsystem.enable( - wait=True, - max_wait=deployer.startup_timeout, - timeout=deployer.request_timeout) - - logger.info('Waiting for %s subsystem', subsystem.type) - subsystem.wait_for_startup(deployer.startup_timeout, deployer.request_timeout) + if config.str2bool(deployer.mdict['pki_hsm_enable']): + logger.info('Stopping PKI server') + instance.stop( + wait=True, + max_wait=deployer.startup_timeout, + timeout=deployer.request_timeout) + else: + logger.info('Starting %s subsystem', subsystem.type) + subsystem.enable( + wait=True, + max_wait=deployer.startup_timeout, + timeout=deployer.request_timeout) + + logger.info('Waiting for %s subsystem', subsystem.type) + subsystem.wait_for_startup(deployer.startup_timeout, deployer.request_timeout) def destroy(self, deployer): pass diff --git a/base/server/python/pki/server/deployment/scriptlets/finalization.py b/base/server/python/pki/server/deployment/scriptlets/finalization.py index 4f3108d8152..f17e8e4c0be 100644 --- a/base/server/python/pki/server/deployment/scriptlets/finalization.py +++ b/base/server/python/pki/server/deployment/scriptlets/finalization.py @@ -70,7 +70,8 @@ def spawn(self, deployer): else: instance.enable() - if len(instance.get_subsystems()) == 1: + if (len(instance.get_subsystems()) == 1 or + config.str2bool(deployer.mdict['pki_hsm_enable'])): logger.info('Starting PKI server') instance.start( wait=True,