python - 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 -sigusr2.
what parameter passed -sigusr2?
ps:
if use -s sigusr2 i'm getting kill: 1: invalid signal number or name: sigusr2
pps:
if use ["-c", "kill", "-sigusr2", master] i'm getting
kill: 1: usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or kill -l [exitstatus]
sig implied.
you want -usr2 instead:
subprocess.popen( ["-c", "kill -usr2 %s" % master], stdout=subprocess.pipe, shell=true).wait() gnu coreutils'kill can give list itself.
$ /bin/kill --list|grep usr2 usr2 edit: mistake. example using shell's kill , not gnu's. didn't shell, based on results, it's dash , not bash. bash allow use either -sigusr2 or -usr2, dash not.
$ dash -c 'kill -l' |grep usr usr1 usr2 $ bash -c 'kill -l' |grep usr 6) sigabrt 7) sigbus 8) sigfpe 9) sigkill 10) sigusr1 11) sigsegv 12) sigusr2 13) sigpipe 14) sigalrm 15) sigterm $ bash -c 'kill -sigusr2 99999' bash: line 0: kill: (99999) - no such process $ bash -c 'kill -usr2 99999' bash: line 0: kill: (99999) - no such process $ bash -c 'kill -notasigspec 99999' bash: line 0: kill: notasigspec: invalid signal specification $ dash -c 'kill -sigusr2 99999' dash: 1: kill: illegal option -s $ dash -c 'kill -usr2 99999' dash: 1: kill: no such process
Comments
Post a Comment