diff --git a/0001-Fedora-29-renamed-fedora-domainname.service.patch b/0001-Fedora-29-renamed-fedora-domainname.service.patch new file mode 100644 index 0000000..2fc56b8 --- /dev/null +++ b/0001-Fedora-29-renamed-fedora-domainname.service.patch @@ -0,0 +1,70 @@ +From 907e1649580b8677d56da6207731addc178dca80 Mon Sep 17 00:00:00 2001 +From: Christian Heimes +Date: Jun 15 2018 06:30:55 +0000 +Subject: Fedora 29 renamed fedora-domainname.service + + +In Fedora 29, the fedora-domainname.service has been renamed to +nis-domainname.service like on RHEL. The ipaplatform service module for +Fedora now only renames the service, when it detects the presence of +fedora-domainname.service. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1588192 +Fixes: https://pagure.io/freeipa/issue/7582 +Signed-off-by: Christian Heimes +Reviewed-By: Rob Crittenden + +--- + +diff --git a/ipaplatform/fedora/services.py b/ipaplatform/fedora/services.py +index 6735153..09ba2e8 100644 +--- a/ipaplatform/fedora/services.py ++++ b/ipaplatform/fedora/services.py +@@ -24,14 +24,23 @@ Contains Fedora-specific service class implementations. + + from __future__ import absolute_import + ++import os ++ + from ipaplatform.redhat import services as redhat_services + + # Mappings from service names as FreeIPA code references to these services + # to their actual systemd service names + fedora_system_units = redhat_services.redhat_system_units.copy() + +-# Service that sets domainname on Fedora is called fedora-domainname.service +-fedora_system_units['domainname'] = 'fedora-domainname.service' ++# 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" ++) ++ ++if HAS_FEDORA_DOMAINNAME_SERVICE: ++ fedora_system_units['domainname'] = 'fedora-domainname.service' + + + # Service classes that implement Fedora-specific behaviour +@@ -44,7 +53,7 @@ class FedoraService(redhat_services.RedHatService): + # of specified name + + def fedora_service_class_factory(name, api=None): +- if name == 'domainname': ++ if HAS_FEDORA_DOMAINNAME_SERVICE and name == 'domainname': + return FedoraService(name, api) + return redhat_services.redhat_service_class_factory(name, api) + +diff --git a/ipaplatform/redhat/services.py b/ipaplatform/redhat/services.py +index 80ad62b..390bbb0 100644 +--- a/ipaplatform/redhat/services.py ++++ b/ipaplatform/redhat/services.py +@@ -47,6 +47,7 @@ redhat_system_units = dict((x, "%s.service" % x) + + redhat_system_units['rpcgssd'] = 'nfs-secure.service' + redhat_system_units['rpcidmapd'] = 'nfs-idmap.service' ++redhat_system_units['domainname'] = 'nis-domainname.service' + + # Rewrite dirsrv and pki-tomcatd services as they support instances via separate + # service generator. To make this working, one needs to have both foo@.servic + diff --git a/freeipa.spec b/freeipa.spec index b5232d2..23ab60d 100644 --- a/freeipa.spec +++ b/freeipa.spec @@ -119,7 +119,7 @@ Name: freeipa Version: %{VERSION} -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Identity, Policy and Audit system Group: System Environment/Base @@ -128,6 +128,8 @@ URL: https://www.freeipa.org/ Source0: https://releases.pagure.org/freeipa/freeipa-%{VERSION}.tar.gz Source1: https://releases.pagure.org/freeipa/freeipa-%{VERSION}.tar.gz.asc +Patch0001: 0001-Fedora-29-renamed-fedora-domainname.service.patch + # For the timestamp trick in patch application BuildRequires: diffstat @@ -1748,6 +1750,10 @@ fi %endif # with_ipatests %changelog +* Thu Jun 15 2018 Rob Crittenden - 4.6.90.pre2-4 +- Rename service fedora-domainname.service to nis-domainname.service + (#1588192) + * Wed May 16 2018 Alexander Bokovoy - 4.6.90.pre2-3 - Fine tune packaging of server templates so that it doesn't include freeipa.template which always go to freeipa-client-common