summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-01-17 09:17:08 -0500
committerSimo Sorce <ssorce@redhat.com>2011-01-18 10:04:19 -0500
commit373455026e37d93c699e4ced579c75e2af8042aa (patch)
tree4144361e332739fa4eb4cf3cb2e514ab736cf643 /ipaserver
parente73efb9a9000c2efb73297340c6268d59a11b6fc (diff)
downloadfreeipa-373455026e37d93c699e4ced579c75e2af8042aa.tar.gz
freeipa-373455026e37d93c699e4ced579c75e2af8042aa.tar.xz
freeipa-373455026e37d93c699e4ced579c75e2af8042aa.zip
Add a way to print output from commands
Instead pof always capturing the output, make it possible to let it go to the standard output pipes. Use this in ipactl to let init scripts show their output. Fixes: https://fedorahosted.org/freeipa/ticket/765
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/service.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index ef3becdf3..1235eaffd 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -41,14 +41,17 @@ SERVICE_LIST = {
'CA':('pki-cad', 50)
}
-def stop(service_name, instance_name=""):
- ipautil.run(["/sbin/service", service_name, "stop", instance_name])
+def stop(service_name, instance_name="", capture_output=True):
+ ipautil.run(["/sbin/service", service_name, "stop", instance_name],
+ capture_output=capture_output)
-def start(service_name, instance_name=""):
- ipautil.run(["/sbin/service", service_name, "start", instance_name])
+def start(service_name, instance_name="", capture_output=True):
+ ipautil.run(["/sbin/service", service_name, "start", instance_name],
+ capture_output=capture_output)
-def restart(service_name, instance_name=""):
- ipautil.run(["/sbin/service", service_name, "restart", instance_name])
+def restart(service_name, instance_name="", capture_output=True):
+ ipautil.run(["/sbin/service", service_name, "restart", instance_name],
+ capture_output=capture_output)
def is_running(service_name, instance_name=""):
ret = True
@@ -217,14 +220,14 @@ class Service:
def set_output(self, fd):
self.output_fd = fd
- def stop(self, instance_name=""):
- stop(self.service_name, instance_name)
+ def stop(self, instance_name="", capture_output=True):
+ stop(self.service_name, instance_name, capture_output=capture_output)
- def start(self, instance_name=""):
- start(self.service_name, instance_name)
+ def start(self, instance_name="", capture_output=True):
+ start(self.service_name, instance_name, capture_output=capture_output)
- def restart(self, instance_name=""):
- restart(self.service_name, instance_name)
+ def restart(self, instance_name="", capture_output=True):
+ restart(self.service_name, instance_name, capture_output=capture_output)
def is_running(self):
return is_running(self.service_name)