diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py index 631086945..17f10e6b6 100644 --- a/ipaplatform/base/paths.py +++ b/ipaplatform/base/paths.py @@ -33,6 +33,7 @@ class BasePathNamespace: LS = "/bin/ls" SYSTEMCTL = "/bin/systemctl" SYSTEMD_DETECT_VIRT = "/usr/bin/systemd-detect-virt" + SYSTEMD_TMPFILES = "/usr/bin/systemd-tmpfiles" TAR = "/bin/tar" AUTOFS_LDAP_AUTH_CONF = "/etc/autofs_ldap_auth.conf" ETC_FEDORA_RELEASE = "/etc/fedora-release" diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index 0fcc370e5..0a9736df2 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -26,6 +26,7 @@ import glob import errno import shlex import pipes +import shutil import tempfile from augeas import Augeas @@ -172,8 +173,10 @@ class HTTPInstance(service.Service): # Make sure that empty env is passed to avoid passing KRB5CCNAME from # current env ipautil.remove_file(paths.HTTP_CCACHE) - for f in os.listdir(paths.IPA_CCACHES): - os.remove(os.path.join(paths.IPA_CCACHES, f)) + shutil.rmtree(paths.IPA_CCACHES) + ipautil.run( + [paths.SYSTEMD_TMPFILES, '--create', '--prefix', paths.IPA_CCACHES] + ) def __configure_http(self): self.update_httpd_service_ipa_conf()