Kills the given processes.
(self, signal=SIGKILL)
| 509 | return procs |
| 510 | |
| 511 | def kill(self, signal=SIGKILL): |
| 512 | """ |
| 513 | Kills the given processes. |
| 514 | """ |
| 515 | if self.container_id is None: |
| 516 | pid = self.get_pid() |
| 517 | assert pid is not None, "No processes for %s" % self |
| 518 | LOG.info('Killing %s with signal %s' % (self, signal)) |
| 519 | exec_process("kill -%d %d" % (signal, pid)) |
| 520 | else: |
| 521 | LOG.info("Stopping container: {0}".format(self.container_id)) |
| 522 | check_call(["docker", "container", "stop", self.container_id]) |
| 523 | |
| 524 | def start(self): |
| 525 | """Start the process with the same arguments after it was stopped.""" |