avoid using preexec_fn in the other places, too

This commit is contained in:
Jakob Ketterl
2020-01-17 21:18:02 +01:00
parent ea5b5dc8fb
commit 470fc43646
2 changed files with 6 additions and 6 deletions

View File

@ -145,13 +145,13 @@ class SdrSource(ABC):
if len(cmd) > 1:
# multiple commands with pipes
cmd = "|".join(cmd)
self.process = subprocess.Popen(cmd, shell=True, preexec_fn=os.setpgrp)
self.process = subprocess.Popen(cmd, shell=True, start_new_session=True)
else:
# single command
cmd = cmd[0]
# preexec_fn can go as soon as there's no piped commands left
# start_new_session can go as soon as there's no piped commands left
# the os.killpg call must be replaced with something more reasonable at the same time
self.process = subprocess.Popen(shlex.split(cmd), preexec_fn=os.setpgrp)
self.process = subprocess.Popen(shlex.split(cmd), start_new_session=True)
logger.info("Started sdr source: " + cmd)
available = False