mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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 <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
7d12bbb99b
commit
907e164958
@ -24,14 +24,23 @@ Contains Fedora-specific service class implementations.
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from ipaplatform.redhat import services as redhat_services
|
from ipaplatform.redhat import services as redhat_services
|
||||||
|
|
||||||
# Mappings from service names as FreeIPA code references to these services
|
# Mappings from service names as FreeIPA code references to these services
|
||||||
# to their actual systemd service names
|
# to their actual systemd service names
|
||||||
fedora_system_units = redhat_services.redhat_system_units.copy()
|
fedora_system_units = redhat_services.redhat_system_units.copy()
|
||||||
|
|
||||||
# Service that sets domainname on Fedora is called fedora-domainname.service
|
# Fedora 28 and earlier have fedora-domainname.service. Starting from
|
||||||
fedora_system_units['domainname'] = 'fedora-domainname.service'
|
# 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
|
# Service classes that implement Fedora-specific behaviour
|
||||||
@ -44,7 +53,7 @@ class FedoraService(redhat_services.RedHatService):
|
|||||||
# of specified name
|
# of specified name
|
||||||
|
|
||||||
def fedora_service_class_factory(name, api=None):
|
def fedora_service_class_factory(name, api=None):
|
||||||
if name == 'domainname':
|
if HAS_FEDORA_DOMAINNAME_SERVICE and name == 'domainname':
|
||||||
return FedoraService(name, api)
|
return FedoraService(name, api)
|
||||||
return redhat_services.redhat_service_class_factory(name, api)
|
return redhat_services.redhat_service_class_factory(name, api)
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ redhat_system_units = dict((x, "%s.service" % x)
|
|||||||
|
|
||||||
redhat_system_units['rpcgssd'] = 'nfs-secure.service'
|
redhat_system_units['rpcgssd'] = 'nfs-secure.service'
|
||||||
redhat_system_units['rpcidmapd'] = 'nfs-idmap.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
|
# 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
|
# service generator. To make this working, one needs to have both foo@.servic
|
||||||
|
Loading…
Reference in New Issue
Block a user