From 379d5da0ae5e54d4d4b8d73979013fad96d123dc Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 6 May 2021 12:02:03 +0200 Subject: [PATCH] pkispawn: override AJP connector address Since commit 1906afbeb3c8b7140601be7f9bee2f7fef5b0a5e, in order to fix rhbz#1780082, pki defines AJP connectors using localhost4 and localhost6: When /etc/hosts only defines the following: 127.0.0.1 localhost ::1 localhost the connector initialization may fail with java.net.BindException: Address already in use The installer can add the following definitions to pkispawn cfg file: pki_ajp_host_ipv4=127.0.0.1 pki_ajp_host_ipv6=::1 in order to force the value to an IP address instead of localhost4/6. Fixes: https://pagure.io/freeipa/issue/8851 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Alexander Bokovoy Reviewed-By: Rob Crittenden --- ipaserver/install/cainstance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index a4961092b..dbcf5fbd2 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -537,6 +537,11 @@ class CAInstance(DogtagInstance): if os.path.exists(paths.IPA_CA_CRT): cfg['pki_cert_chain_path'] = paths.IPA_CA_CRT + # Use IP address instead of default localhost4 and localhost6 + # because /etc/hosts does not always define them + cfg['pki_ajp_host_ipv4'] = "127.0.0.1" + cfg['pki_ajp_host_ipv6'] = "::1" + if self.clone: if self.no_db_setup: cfg.update(