agent: Use PIPE for stdin, stdout, and stderr in dropper
The dropper is expected to detatch the child monkey agent process. If stdin, stdout, and stderr are set to `None`, the child process inherits them. Since the child process inherits the parent's file descriptors and holds them open, issues like #1026 can occur.
This commit is contained in:
parent
4ac7c01976
commit
e7528e9544
|
@ -134,7 +134,9 @@ class MonkeyDrops(object):
|
||||||
'monkey_commandline': inner_monkey_cmdline}
|
'monkey_commandline': inner_monkey_cmdline}
|
||||||
|
|
||||||
monkey_process = subprocess.Popen(monkey_cmdline, shell=True,
|
monkey_process = subprocess.Popen(monkey_cmdline, shell=True,
|
||||||
stdin=None, stdout=None, stderr=None,
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
close_fds=True, creationflags=DETACHED_PROCESS)
|
close_fds=True, creationflags=DETACHED_PROCESS)
|
||||||
|
|
||||||
LOG.info("Executed monkey process (PID=%d) with command line: %s",
|
LOG.info("Executed monkey process (PID=%d) with command line: %s",
|
||||||
|
|
Loading…
Reference in New Issue