URL: https://github.com/freeipa/freeipa/pull/748
Author: pvoborni
 Title: #748: restore: restart/reload gssproxy after restore
Action: opened

PR body:
"""
So that gssproxy picks up new configuration and therefore related
usages like authentication of CLI against server works

https://pagure.io/freeipa/issue/6902
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/748/head:pr748
git checkout pr748
From d49d50c8af896425f5c63950edde08bd88dbb46f Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 26 Apr 2017 18:47:53 +0200
Subject: [PATCH] restore: restart/reload gssproxy after restore

So that gssproxy picks up new configuration and therefore related
usages like authentication of CLI against server works

https://pagure.io/freeipa/issue/6902
---
 ipaplatform/base/services.py     | 21 ++++++++++++++++++---
 ipaserver/install/ipa_restore.py |  3 +++
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ipaplatform/base/services.py b/ipaplatform/base/services.py
index 068b972..fca6298 100644
--- a/ipaplatform/base/services.py
+++ b/ipaplatform/base/services.py
@@ -154,6 +154,10 @@ def stop(self, instance_name="", capture_output=True,
 
         return
 
+    def reload_or_restart(self, instance_name="", capture_output=True,
+                          wait=True):
+        return
+
     def restart(self, instance_name="", capture_output=True, wait=True):
         return
 
@@ -298,14 +302,25 @@ def start(self, instance_name="", capture_output=True, wait=True):
             instance_name,
             update_service_list=update_service_list)
 
-    def restart(self, instance_name="", capture_output=True, wait=True):
-        ipautil.run([paths.SYSTEMCTL, "restart",
-                     self.service_instance(instance_name)],
+    def _restart_base(self, instance_name, operation, capture_output=True,
+                      wait=False):
+
+        ipautil.run([paths.SYSTEMCTL, operation,
+                    self.service_instance(instance_name)],
                     skip_output=not capture_output)
 
         if wait and self.is_running(instance_name):
             self.wait_for_open_ports(self.service_instance(instance_name))
 
+    def reload_or_restart(self, instance_name="", capture_output=True,
+                          wait=True):
+        self._restart_base(instance_name, "reload-or-restart",
+                           capture_output, wait)
+
+    def restart(self, instance_name="", capture_output=True, wait=True):
+        self._restart_base(instance_name, "restart",
+                           capture_output, wait)
+
     def is_running(self, instance_name="", wait=True):
         instance = self.service_instance(instance_name, 'is-active')
 
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 378c013..96fc493 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -401,6 +401,9 @@ def run(self):
                 services.knownservices.pki_tomcatd.enable()
                 services.knownservices.pki_tomcatd.disable()
 
+                self.log.info('Restarting GSS-proxy')
+                gssproxy = services.service('gssproxy', api)
+                gssproxy.reload_or_restart()
                 self.log.info('Starting IPA services')
                 run(['ipactl', 'start'])
                 self.log.info('Restarting SSSD')
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to