From c0bb0ee8e36a85673e30352a7205414b215196a5 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 8 May 2017 18:53:26 +0200 Subject: [PATCH] pkispawn: wait after final restart The finalization scriptlet now waits after service has been restarted. Change-Id: Id462728386b9d7e6b3364e1651ef6676115dd1de Bugzilla: BZ#1446364 Pagure: 2644 Signed-off-by: Christian Heimes --- .travis/40-spawn-ca | 5 ----- .travis/50-spawn-kra | 5 ----- .../pki/server/deployment/scriptlets/finalization.py | 7 +++++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.travis/40-spawn-ca b/.travis/40-spawn-ca index d6771dbc9b6..d57e6b7e717 100755 --- a/.travis/40-spawn-ca +++ b/.travis/40-spawn-ca @@ -2,8 +2,3 @@ set -e pkispawn -vv -f ${BUILDDIR}/pki/.travis/pki.cfg -s CA - -echo "Waiting for port 8080" -for i in {1..20}; do - curl http://localhost:8080 && break || sleep 1 -done diff --git a/.travis/50-spawn-kra b/.travis/50-spawn-kra index 93f2f4c3fde..f7e8fc10ab4 100755 --- a/.travis/50-spawn-kra +++ b/.travis/50-spawn-kra @@ -2,8 +2,3 @@ set -e pkispawn -vv -f ${BUILDDIR}/pki/.travis/pki.cfg -s KRA - -echo "Waiting for port 8080" -for i in {1..20}; do - curl http://localhost:8080 && break || sleep 1 -done diff --git a/base/server/python/pki/server/deployment/scriptlets/finalization.py b/base/server/python/pki/server/deployment/scriptlets/finalization.py index 3dc7f66de3e..941691c429b 100644 --- a/base/server/python/pki/server/deployment/scriptlets/finalization.py +++ b/base/server/python/pki/server/deployment/scriptlets/finalization.py @@ -57,6 +57,13 @@ def spawn(self, deployer): # Optionally, programmatically 'restart' the configured PKI instance if config.str2bool(deployer.mdict['pki_restart_configured_instance']): deployer.systemd.restart() + # wait for startup + status = deployer.instance.wait_for_startup(60) + if status is None: + config.pki_log.error( + "server failed to restart", + extra=config.PKI_INDENTATION_LEVEL_1) + raise RuntimeError("server failed to restart") # Optionally, 'purge' the entire temporary client infrastructure # including the client NSS security databases and password files