bb0ded
From 9b6d0bb1245c4891ccc270f360d0f72a4b1444c1 Mon Sep 17 00:00:00 2001
bb0ded
From: Rob Crittenden <rcritten@redhat.com>
bb0ded
Date: Mon, 7 Feb 2022 10:39:55 -0500
bb0ded
Subject: [PATCH] Enable the ccache sweep timer during installation
bb0ded
bb0ded
The timer was only being enabled during package installation
bb0ded
if IPA was configured. So effectively only on upgrade.
bb0ded
bb0ded
Add as a separate installation step after the ccache directory
bb0ded
is configured.
bb0ded
bb0ded
Fixes: https://pagure.io/freeipa/issue/9107
bb0ded
bb0ded
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
bb0ded
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
bb0ded
---
bb0ded
 ipaserver/install/httpinstance.py | 7 +++++++
bb0ded
 1 file changed, 7 insertions(+)
bb0ded
bb0ded
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
bb0ded
index 732bb58d49addcb2a9f7698d577527257a17fe66..50ccf5e5031c37171cebe6f20232f3bd645cedeb 100644
bb0ded
--- a/ipaserver/install/httpinstance.py
bb0ded
+++ b/ipaserver/install/httpinstance.py
bb0ded
@@ -140,6 +140,8 @@ class HTTPInstance(service.Service):
bb0ded
         self.step("publish CA cert", self.__publish_ca_cert)
bb0ded
         self.step("clean up any existing httpd ccaches",
bb0ded
                   self.remove_httpd_ccaches)
bb0ded
+        self.step("enable ccache sweep",
bb0ded
+                  self.enable_ccache_sweep)
bb0ded
         self.step("configuring SELinux for httpd", self.configure_selinux_for_httpd)
bb0ded
         if not self.is_kdcproxy_configured():
bb0ded
             self.step("create KDC proxy config", self.create_kdcproxy_conf)
bb0ded
@@ -177,6 +179,11 @@ class HTTPInstance(service.Service):
bb0ded
             [paths.SYSTEMD_TMPFILES, '--create', '--prefix', paths.IPA_CCACHES]
bb0ded
         )
bb0ded
 
bb0ded
+    def enable_ccache_sweep(self):
bb0ded
+        ipautil.run(
bb0ded
+            [paths.SYSTEMCTL, 'enable', 'ipa-ccache-sweep.timer']
bb0ded
+        )
bb0ded
+
bb0ded
     def __configure_http(self):
bb0ded
         self.update_httpd_service_ipa_conf()
bb0ded
         self.update_httpd_wsgi_conf()
bb0ded
-- 
bb0ded
2.34.1
bb0ded