summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2015-07-08 15:45:18 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-08 17:14:56 +0200
commit9c5df3cf76c921d268e7892ef9d9e7a7d2ad89f9 (patch)
tree20f467a125e745b76a651c6762644d453ef3ea56
parent675aada2e1136bd21ea4f34984fc5603320d09c4 (diff)
downloadfreeipa-9c5df3cf76c921d268e7892ef9d9e7a7d2ad89f9.tar.gz
freeipa-9c5df3cf76c921d268e7892ef9d9e7a7d2ad89f9.tar.xz
freeipa-9c5df3cf76c921d268e7892ef9d9e7a7d2ad89f9.zip
upgrade: Enable and start oddjobd if adtrust is available
If ipa-adtrust-install has already been run on the system, enable and start the oddjobd service. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
-rw-r--r--install/updates/90-post_upgrade_plugins.update1
-rw-r--r--ipaserver/install/plugins/adtrust.py24
2 files changed, 25 insertions, 0 deletions
diff --git a/install/updates/90-post_upgrade_plugins.update b/install/updates/90-post_upgrade_plugins.update
index 8e8fe0941..3df3a4574 100644
--- a/install/updates/90-post_upgrade_plugins.update
+++ b/install/updates/90-post_upgrade_plugins.update
@@ -18,3 +18,4 @@ plugin: update_managed_post
plugin: update_managed_permissions
plugin: update_idrange_baserid
plugin: update_passync_privilege_update
+plugin: update_oddjobd_for_adtrust
diff --git a/ipaserver/install/plugins/adtrust.py b/ipaserver/install/plugins/adtrust.py
index d96bfe83e..45bcc5f2f 100644
--- a/ipaserver/install/plugins/adtrust.py
+++ b/ipaserver/install/plugins/adtrust.py
@@ -19,8 +19,11 @@
from ipalib import api, errors
from ipalib import Updater
+from ipaplatform.paths import paths
from ipapython.dn import DN
from ipapython.ipa_log_manager import *
+from ipapython import sysrestore
+from ipaserver.install import installutils
DEFAULT_ID_RANGE_SIZE = 200000
@@ -161,5 +164,26 @@ class update_default_trust_view(Updater):
return False, [update]
+
+class update_oddjobd_for_adtrust(Updater):
+ """
+ Enables and starts oddjobd daemon if ipa-adtrust-install has been run
+ on this system.
+ """
+
+ def execute(self, **options):
+ adtrust_is_enabled = self.api.Command['adtrust_is_enabled']()['result']
+
+ if adtrust_is_enabled:
+ self.log.debug('Try to enable and start oddjobd')
+ sstore = sysrestore.StateFile(paths.SYSRESTORE)
+ installutils.enable_and_start_oddjobd(sstore)
+ else:
+ self.log.debug('ADTrust not configured on this server, do not '
+ 'start and enable oddjobd')
+
+ return False, []
+
api.register(update_default_range)
api.register(update_default_trust_view)
+api.register(update_oddjobd_for_adtrust)