summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2015-07-08 15:44:13 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-08 17:14:56 +0200
commit675aada2e1136bd21ea4f34984fc5603320d09c4 (patch)
tree22c439e1716a77d09bac40f57e7ead6a5afc49ea
parentec7e5e0cac4d93f4a0bb62c1de28be46f362740b (diff)
downloadfreeipa-675aada2e1136bd21ea4f34984fc5603320d09c4.tar.gz
freeipa-675aada2e1136bd21ea4f34984fc5603320d09c4.tar.xz
freeipa-675aada2e1136bd21ea4f34984fc5603320d09c4.zip
adtrustinstance: Enable and start oddjobd
Enable and start the oddjobd service as part of the ipa-adtrust-install for the new IPA installations. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
-rw-r--r--ipaserver/install/adtrustinstance.py19
-rw-r--r--ipaserver/install/installutils.py11
2 files changed, 30 insertions, 0 deletions
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index 8343f8182..ff0e8cc3e 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -706,6 +706,9 @@ class ADTRUSTInstance(service.Service):
except Exception, e:
root_logger.critical("Enabling nsswitch support in slapi-nis failed with error '%s'" % e)
+ def __enable_and_start_oddjobd(self):
+ installutils.enable_and_start_oddjobd(self.sstore)
+
def __start(self):
try:
self.start()
@@ -852,6 +855,7 @@ class ADTRUSTInstance(service.Service):
self.step("adding Default Trust View", self.__add_default_trust_view)
self.step("setting SELinux booleans", \
self.__configure_selinux_for_smbd)
+ self.step("enabling oddjobd", self.__enable_and_start_oddjobd)
self.step("starting CIFS services", self.__start)
if self.add_sids:
@@ -880,6 +884,21 @@ class ADTRUSTInstance(service.Service):
except Exception:
pass
+ # Restore oddjobd to its original state
+ oddjobd = services.service('oddjobd')
+
+ if not self.sstore.restore_state('oddjobd', 'running'):
+ try:
+ oddjobd.stop()
+ except Exception:
+ pass
+
+ if not self.sstore.restore_state('oddjobd', 'enabled'):
+ try:
+ oddjobd.disable()
+ except Exception:
+ pass
+
# Since we do not guarantee restoring back to working samba state,
# we should not restore smb.conf
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index 08620c472..02e852631 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -1081,3 +1081,14 @@ def check_version():
def realm_to_serverid(realm_name):
return "-".join(realm_name.split("."))
+
+def enable_and_start_oddjobd(sstore):
+ oddjobd = services.service('oddjobd')
+ sstore.backup_state('oddjobd', 'running', oddjobd.is_running())
+ sstore.backup_state('oddjobd', 'enabled', oddjobd.is_enabled())
+
+ try:
+ oddjobd.enable()
+ oddjobd.start()
+ except Exception as e:
+ root_logger.critical("Unable to start oddjobd: {0}".format(str(e)))