pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0132-Start-named-during-configuration-upgrade.patch

403b09
From 82ffbefb88013e125e8377fe525fdef1de0c7ad4 Mon Sep 17 00:00:00 2001
403b09
From: Martin Basti <mbasti@redhat.com>
403b09
Date: Tue, 13 Sep 2016 18:37:43 +0200
403b09
Subject: [PATCH] Start named during configuration upgrade.
403b09
403b09
Some upgrade steps require bind running, to be succesfull. Upgrader
403b09
makes sure that bind starts.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6205
403b09
403b09
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
403b09
---
403b09
 ipaserver/install/server/upgrade.py | 12 ++++++++++++
403b09
 1 file changed, 12 insertions(+)
403b09
403b09
diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
403b09
index 43427178b11f63797a9537eadee836d7cf224311..e1343f423cec21f02e3d9581012496baa7b30cc6 100644
403b09
--- a/ipaserver/install/server/upgrade.py
403b09
+++ b/ipaserver/install/server/upgrade.py
403b09
@@ -1706,6 +1706,15 @@ def upgrade_configuration():
403b09
     cleanup_kdc(fstore)
403b09
     cleanup_adtrust(fstore)
403b09
     setup_firefox_extension(fstore)
403b09
+
403b09
+    bind = bindinstance.BindInstance(fstore)
403b09
+    if bind.is_configured() and not bind.is_running():
403b09
+        # some upgrade steps may require bind running
403b09
+        bind_started = True
403b09
+        bind.start()
403b09
+    else:
403b09
+        bind_started = False
403b09
+
403b09
     add_ca_dns_records()
403b09
 
403b09
     # Any of the following functions returns True iff the named.conf file
403b09
@@ -1736,6 +1745,9 @@ def upgrade_configuration():
403b09
         except ipautil.CalledProcessError as e:
403b09
             root_logger.error("Failed to restart %s: %s", bind.service_name, e)
403b09
 
403b09
+    if bind_started:
403b09
+        bind.stop()
403b09
+
403b09
     custodia = custodiainstance.CustodiaInstance(api.env.host, api.env.realm)
403b09
     custodia.upgrade_instance()
403b09
 
403b09
-- 
403b09
2.7.4
403b09