diff options
Diffstat (limited to 'lorry-controller-minion')
-rwxr-xr-x | lorry-controller-minion | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lorry-controller-minion b/lorry-controller-minion index 72f1a39..9eb6657 100755 --- a/lorry-controller-minion +++ b/lorry-controller-minion @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2019 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ import os import platform import random import select +import signal import subprocess import tempfile import time @@ -171,7 +172,8 @@ class MINION(cliapp.Application): argv, stdin=devnull, stdout=pipe[1], - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, + preexec_fn=os.setsid) os.close(pipe[1]) devnull.close() @@ -212,7 +214,8 @@ class MINION(cliapp.Application): return stdout, stderr, exit def kill_job(self): - self.process.kill() + pgid = os.getpgid(self.process.pid) + os.killpg(pgid, signal.SIGKILL) return self.process.wait() def update_webapp_about_job(self, job_spec, stdout, stderr, exit): |