diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-01-17 09:17:08 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-01-18 10:04:19 -0500 |
commit | 373455026e37d93c699e4ced579c75e2af8042aa (patch) | |
tree | 4144361e332739fa4eb4cf3cb2e514ab736cf643 /ipaserver | |
parent | e73efb9a9000c2efb73297340c6268d59a11b6fc (diff) | |
download | freeipa-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.py | 27 |
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) |