diff options
author | Misnyovszki Adam <amisnyov@redhat.com> | 2014-02-19 16:41:39 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-02-19 17:47:57 +0100 |
commit | a1459e38e7e88a0ba7b96ee7a1bf463583654063 (patch) | |
tree | f24c479206903eb0c3eeed21a77414106bd8f493 | |
parent | b769d1c18678b5eede7505dec7938f6836070044 (diff) | |
download | freeipa-a1459e38e7e88a0ba7b96ee7a1bf463583654063.tar.gz freeipa-a1459e38e7e88a0ba7b96ee7a1bf463583654063.tar.xz freeipa-a1459e38e7e88a0ba7b96ee7a1bf463583654063.zip |
ipactl can not restart ipa services if current status is stopped
fixed by starting the directory server when restarting if it is not
currently running to enable fetching running services
later restart didn't check that
also added a check, that if the directory server started at the
beginning, there is no need to restart it
https://fedorahosted.org/freeipa/ticket/4050
Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rwxr-xr-x | install/tools/ipactl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/install/tools/ipactl b/install/tools/ipactl index fd1e5e615..58c7f316d 100755 --- a/install/tools/ipactl +++ b/install/tools/ipactl @@ -291,6 +291,15 @@ def ipa_stop(options): def ipa_restart(options): dirsrv = ipaservices.knownservices.dirsrv new_svc_list = [] + dirsrv_restart = True + if not dirsrv.is_running(): + try: + print "Starting Directory Service" + dirsrv.start(capture_output=get_capture_output('dirsrv', options.debug)) + dirsrv_restart = False + except Exception, e: + raise IpactlError("Failed to start Directory Service: " + str(e)) + try: new_svc_list = get_config(dirsrv) except Exception, e: @@ -339,8 +348,9 @@ def ipa_restart(options): emit_err("Failed to stop %s Service" % svc) try: - print "Restarting Directory Service" - dirsrv.restart(capture_output=get_capture_output('dirsrv', options.debug)) + if dirsrv_restart: + print "Restarting Directory Service" + dirsrv.restart(capture_output=get_capture_output('dirsrv', options.debug)) except Exception, e: emit_err("Failed to restart Directory Service: " + str(e)) emit_err("Shutting down") |