pgreco / rpms / ipa

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

Blame SOURCES/0006-tasks-run-systemctl-daemon-reload-after-httpd.servic.patch

483b06
From d8a9ed4e2fc164962d76773b57277f97bca84270 Mon Sep 17 00:00:00 2001
483b06
From: Jan Cholasta <jcholast@redhat.com>
483b06
Date: Thu, 16 Mar 2017 12:51:29 +0000
483b06
Subject: [PATCH] tasks: run `systemctl daemon-reload` after httpd.service.d
483b06
 updates
483b06
483b06
Run `systemctl daemon-reload` after
483b06
`/etc/systemd/system/httpd.service.d/ipa.conf` is created or deleted,
483b06
otherwise systemd will not merge the file into httpd.service and therefore
483b06
required environment variables will not be set for httpd.
483b06
483b06
This fixes authentication failures ("No valid Negotiate header in server
483b06
response") due to missing `GSS_USE_PROXY=yes` in httpd environment.
483b06
483b06
https://pagure.io/freeipa/issue/6773
483b06
483b06
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
483b06
---
483b06
 ipaplatform/redhat/tasks.py | 7 +++++++
483b06
 1 file changed, 7 insertions(+)
483b06
483b06
diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
483b06
index c1b574e06fc52839b684cbe96587365fa107b2eb..d0ef5fbd1ceb8110dd417dda44a74dc63898456a 100644
483b06
--- a/ipaplatform/redhat/tasks.py
483b06
+++ b/ipaplatform/redhat/tasks.py
483b06
@@ -483,6 +483,9 @@ class RedHatTaskNamespace(BaseTaskNamespace):
483b06
         os.chmod(paths.SYSTEMD_SYSTEM_HTTPD_IPA_CONF, 0o644)
483b06
         self.restore_context(paths.SYSTEMD_SYSTEM_HTTPD_IPA_CONF)
483b06
 
483b06
+        ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"],
483b06
+                    raiseonerr=False)
483b06
+
483b06
     def configure_http_gssproxy_conf(self):
483b06
         ipautil.copy_template_file(
483b06
             os.path.join(paths.USR_SHARE_IPA_DIR, 'gssproxy.conf.template'),
483b06
@@ -513,6 +516,10 @@ class RedHatTaskNamespace(BaseTaskNamespace):
483b06
                     'Error removing %s: %s',
483b06
                     paths.SYSTEMD_SYSTEM_HTTPD_IPA_CONF, e
483b06
                 )
483b06
+            return
483b06
+
483b06
+        ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"],
483b06
+                    raiseonerr=False)
483b06
 
483b06
     def set_hostname(self, hostname):
483b06
         ipautil.run([paths.BIN_HOSTNAMECTL, 'set-hostname', hostname])
483b06
-- 
483b06
2.12.1
483b06