mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-client-install: enable and start oddjobd if mkhomedir
Since the switch to authselect, the service oddjobd is not automatically enabled when ipa client is installed with --mkhomedir. The fix makes sure that the service is enabled/started, and stores the pre-install state in sysrestore.state, in order to revert to the pre-install state when uninstall is called Fixes: https://pagure.io/freeipa/issue/7604 Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
d622be295a
commit
a39f656340
@ -2969,6 +2969,20 @@ def _install(options):
|
|||||||
statestore=statestore,
|
statestore=statestore,
|
||||||
sudo=options.conf_sudo
|
sudo=options.conf_sudo
|
||||||
)
|
)
|
||||||
|
# if mkhomedir, make sure oddjobd is enabled and started
|
||||||
|
if options.mkhomedir:
|
||||||
|
oddjobd = services.service('oddjobd', api)
|
||||||
|
running = oddjobd.is_running()
|
||||||
|
enabled = oddjobd.is_enabled()
|
||||||
|
statestore.backup_state('oddjobd', 'running', running)
|
||||||
|
statestore.backup_state('oddjobd', 'enabled', enabled)
|
||||||
|
try:
|
||||||
|
if not enabled:
|
||||||
|
oddjobd.enable()
|
||||||
|
if not running:
|
||||||
|
oddjobd.start()
|
||||||
|
except Exception as e:
|
||||||
|
logger.critical("Unable to start oddjobd: %s", str(e))
|
||||||
|
|
||||||
logger.info("%s enabled", "SSSD" if options.sssd else "LDAP")
|
logger.info("%s enabled", "SSSD" if options.sssd else "LDAP")
|
||||||
|
|
||||||
@ -3213,6 +3227,20 @@ def uninstall(options):
|
|||||||
logger.error(
|
logger.error(
|
||||||
"Failed to remove Kerberos service principals: %s", str(e))
|
"Failed to remove Kerberos service principals: %s", str(e))
|
||||||
|
|
||||||
|
# Restore oddjobd to its original state
|
||||||
|
oddjobd = services.service('oddjobd', api)
|
||||||
|
if not statestore.restore_state('oddjobd', 'running'):
|
||||||
|
try:
|
||||||
|
oddjobd.stop()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not statestore.restore_state('oddjobd', 'enabled'):
|
||||||
|
try:
|
||||||
|
oddjobd.disable()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
logger.info("Disabling client Kerberos and LDAP configurations")
|
logger.info("Disabling client Kerberos and LDAP configurations")
|
||||||
was_sssd_installed = False
|
was_sssd_installed = False
|
||||||
was_sshd_configured = False
|
was_sshd_configured = False
|
||||||
|
Loading…
Reference in New Issue
Block a user