Skip to content

Commit

Permalink
Restart the instance when new subsystems are deployed
Browse files Browse the repository at this point in the history
If a new subsystem is deployed in a existing instance this not restarted
during the installation but the new web-app is just enabled.

When the subsystem are configured to work with an HSM this could
generate problems because certificates added during the installation
with external tools are recognised. The instance restart will clean the
internal cache and reference to the HSM and all certificates are
identified.

Fix the issue #4335
  • Loading branch information
fmarco76 committed Sep 21, 2023
1 parent 6a88ec2 commit 41708de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 41708de

Please sign in to comment.