Thursday, 15 August 2013

How to properly pass dash parameters to subprocessPopen

How to properly pass dash parameters to subprocessPopen

subprocess.Popen( ["-c", "kill -SIGUSR2 %s" % master],
stdout=subprocess.PIPE, shell=True).wait()
I'm getting
kill: 1: Illegal option -S
which refers to -SIGUSR2.
What would I do for that parameter to be passed completely as -SIGUSR2?
PS:
If I use -s SIGUSR2 I'm getting kill: 1: invalid signal number or name:
SIGUSR2
PPS:
If I use ["-c", "kill", "-SIGUSR2", master] I'm getting
kill: 1: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

No comments:

Post a Comment