summaryrefslogtreecommitdiffstats
path: root/install/tools/ipactl
diff options
context:
space:
mode:
authorAna Krivokapic <akrivoka@redhat.com>2013-04-26 14:46:17 +0200
committerRob Crittenden <rcritten@redhat.com>2013-04-29 09:38:30 -0400
commitdfcdd9c403be81e81c88e7f6644394ee1bef14f3 (patch)
tree8bce07921c6835c09d7ae473e434927c4f5b5cac /install/tools/ipactl
parentd4a0fa34afd30765e5ea6f0df21976a6494f13d6 (diff)
downloadfreeipa-dfcdd9c403be81e81c88e7f6644394ee1bef14f3.tar.gz
freeipa-dfcdd9c403be81e81c88e7f6644394ee1bef14f3.tar.xz
freeipa-dfcdd9c403be81e81c88e7f6644394ee1bef14f3.zip
Always stop dirsrv in 'ipactl stop'
Ensure that 'ipactl stop' stops the dirsrv instance, even when no other services are running. https://fedorahosted.org/freeipa/ticket/3574
Diffstat (limited to 'install/tools/ipactl')
-rwxr-xr-xinstall/tools/ipactl20
1 files changed, 9 insertions, 11 deletions
diff --git a/install/tools/ipactl b/install/tools/ipactl
index 6500c274c..2d699880c 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -252,7 +252,6 @@ def ipa_start(options):
def ipa_stop(options):
dirsrv = ipaservices.knownservices.dirsrv
- svc_list = []
try:
svc_list = get_config_from_file()
except Exception, e:
@@ -270,9 +269,11 @@ def ipa_stop(options):
finally:
raise IpactlError()
- if len(svc_list) == 0:
- # no service to stop
- return
+ try:
+ print "Stopping Directory Service"
+ dirsrv.stop(capture_output=False)
+ except:
+ raise IpactlError("Failed to stop Directory Service")
for svc in reversed(svc_list):
svchandle = ipaservices.service(svc)
@@ -282,14 +283,11 @@ def ipa_stop(options):
except:
emit_err("Failed to stop %s Service" % svc)
- try:
- print "Stopping Directory Service"
- dirsrv.stop(capture_output=False)
- except:
- raise IpactlError("Failed to stop Directory Service")
-
# remove file with list of started services
- os.unlink(ipaservices.SVC_LIST_FILE)
+ try:
+ os.unlink(ipaservices.SVC_LIST_FILE)
+ except OSError:
+ pass
def ipa_restart(options):