| 85 | self.paused = False |
| 86 | |
| 87 | def destroy(self): |
| 88 | if self.process is not None: |
| 89 | tmp = self.process |
| 90 | # This will signal to the log thread that everything is going to be shut down |
| 91 | # and ignore any future messages. In particular bash may log something like 'Terminated: <PID>' |
| 92 | # which would pollute the output of this script. |
| 93 | self.process = None |
| 94 | reap(tmp) |
| 95 | self.process = None |
| 96 | super().destroy() |
| 97 | |
| 98 | def reap(process, timeout=3): |
| 99 | "Tries hard to terminate and ultimately kill all the children of this process." |