commit 1c03181e78b8f43e7bfd32e52c5b9d161c326fd6 Author: Christian Heimes Date: Wed Aug 29 12:58:12 2018 +0200 Don't check for systemd service ipaplatform no longer checks for the presence of a systemd service file to detect the name of the domainname service. Instead it uses osinfo's version to use the old name on Fedora 28 and the new name on Fedora 29. This fixes a SELinux violation that prevented httpd from listing systemd service files. Fixes: https://pagure.io/freeipa/issue/7661 Signed-off-by: Christian Heimes Reviewed-By: Rob Crittenden diff --git a/ipaplatform/fedora/services.py b/ipaplatform/fedora/services.py index 09ba2e826..5ff64f1cd 100644 --- a/ipaplatform/fedora/services.py +++ b/ipaplatform/fedora/services.py @@ -24,8 +24,7 @@ Contains Fedora-specific service class implementations. from __future__ import absolute_import -import os - +from ipaplatform.osinfo import osinfo from ipaplatform.redhat import services as redhat_services # Mappings from service names as FreeIPA code references to these services @@ -35,9 +34,7 @@ fedora_system_units = redhat_services.redhat_system_units.copy() # Fedora 28 and earlier have fedora-domainname.service. Starting from # Fedora 29, the service is called nis-domainname.service as defined in # ipaplatform.redhat.services. -HAS_FEDORA_DOMAINNAME_SERVICE = os.path.isfile( - "/usr/lib/systemd/system/fedora-domainname.service" -) +HAS_FEDORA_DOMAINNAME_SERVICE = int(osinfo.version_id) <= 28 if HAS_FEDORA_DOMAINNAME_SERVICE: fedora_system_units['domainname'] = 'fedora-domainname.service'