The root cause of this issue is:
There're two different kinds of kill in popular Linux distributions, one comes from bash, which a bash built in. Another one comes from system, located at /bin/kill.
When running which kill, it shows /bin/kill, but if running type -a kill, it tells you the truth:
user@workernode1:~$ type -a kill
kill is a shell builtin
kill is /bin/kill
HADOOP-12317, kill command becomes:
kill -0 – -<pid>
Bash built-in kill cmd can support syntax like this, but /bin/kill doesn't support it. By some reason, Hadoop Shell pickes up /bin/kill instead of bash built-in kill.
Steps to reproduce this issue (Ubuntu 12.04)
1) Run nohup sleep 1000 &
2) Run ps -ef | grep sleep
hrt_qa@workernode1:~$ ps -ef | grep sleep
hrt_qa 46531 44212 0 23:29 pts/1 00:00:00 sleep 1000
3) Run kill (or bin/kill) -0 – -44212, kill and /bin/kill has different behavior.
Tested Ubuntu 14, it doesn't have this issue.