From eef446be9f3a2186f8e15ca36e990c63f0014e55 Mon Sep 17 00:00:00 2001 From: R2boyo25 Date: Tue, 22 Mar 2022 20:58:13 -0500 Subject: [PATCH] fix killing processes --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2372668..2928349 100644 --- a/main.py +++ b/main.py @@ -38,13 +38,13 @@ def start(self): for var in proc['env'].keys(): self.env[var] = proc['env'][var] - self.process = subprocess.Popen(command, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, cwd = workdir, env = self.env, shell = True) + self.process = subprocess.Popen(command, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, cwd = workdir, env = self.env, shell = True, preexec_fn=os.setsid) flags = fcntl(self.process.stdout, F_GETFL) fcntl(self.process.stdout, F_SETFL, flags | O_NONBLOCK) def kill(self): - self.process.kill() + os.killpg(self.process.pid, signal.SIGTERM) @property def out(self):