mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Guard dbus.start() with dbus.is_running()
Some platforms like Debian protect the dbus.service with RefuseManualStart=True. "systemctl start dbus" fails with operation refused (it is configured to refuse manual start/stop). On Fedora "systemctl start dbus" is a no-op when dbus is already running. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
@@ -981,7 +981,9 @@ class CAInstance(DogtagInstance):
|
||||
# cause files to have a new owner.
|
||||
self.restore_state("user_exists")
|
||||
|
||||
services.knownservices.dbus.start()
|
||||
if not services.knownservices.dbus.is_running():
|
||||
# some platforms protect dbus with RefuseManualStart=True
|
||||
services.knownservices.dbus.start()
|
||||
cmonger = services.knownservices.certmonger
|
||||
cmonger.start()
|
||||
|
||||
|
||||
@@ -286,7 +286,9 @@ class DogtagInstance(service.Service):
|
||||
"""
|
||||
cmonger = services.knownservices.certmonger
|
||||
cmonger.enable()
|
||||
services.knownservices.dbus.start()
|
||||
if not services.knownservices.dbus.is_running():
|
||||
# some platforms protect dbus with RefuseManualStart=True
|
||||
services.knownservices.dbus.start()
|
||||
cmonger.start()
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
@@ -363,7 +365,9 @@ class DogtagInstance(service.Service):
|
||||
"for %s", self.subsystem)
|
||||
|
||||
cmonger = services.knownservices.certmonger
|
||||
services.knownservices.dbus.start()
|
||||
if not services.knownservices.dbus.is_running():
|
||||
# some platforms protect dbus with RefuseManualStart=True
|
||||
services.knownservices.dbus.start()
|
||||
cmonger.start()
|
||||
|
||||
nicknames = list(self.tracking_reqs)
|
||||
|
||||
@@ -362,11 +362,13 @@ def check_dns_resolution(host_name, dns_servers):
|
||||
|
||||
def configure_certmonger():
|
||||
dbus = services.knownservices.dbus
|
||||
try:
|
||||
dbus.start()
|
||||
except Exception as e:
|
||||
raise ScriptError("dbus service unavailable: %s" % str(e),
|
||||
rval=3)
|
||||
if not dbus.is_running():
|
||||
# some platforms protect dbus with RefuseManualStart=True
|
||||
try:
|
||||
dbus.start()
|
||||
except Exception as e:
|
||||
raise ScriptError("dbus service unavailable: %s" % str(e),
|
||||
rval=3)
|
||||
|
||||
# Ensure that certmonger has been started at least once to generate the
|
||||
# cas files in /var/lib/certmonger/cas.
|
||||
|
||||
Reference in New Issue
Block a user