[
https://issues.apache.org/jira/browse/HADOOP-11989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14547329#comment-14547329
]
Chackaravarthy commented on HADOOP-11989:
-----------------------------------------
Below snippets need to be modified to include double dash also while
constructing the command.
{code:title=Shell.java|borderStyle=solid}
/** Return a command for determining if process with specified pid is alive. */
public static String[] getCheckProcessIsAliveCommand(String pid) {
return Shell.WINDOWS ?
new String[] { Shell.WINUTILS, "task", "isAlive", pid } :
new String[] { "kill", "-0", isSetsidAvailable ? "-" + pid : pid };
}
{code}
{code:title=Shell.java|borderStyle=solid}
/** Return a command to send a signal to a given pid */
public static String[] getSignalKillCommand(int code, String pid) {
return Shell.WINDOWS ? new String[] { Shell.WINUTILS, "task", "kill", pid }
:
new String[] { "kill", "-" + code, isSetsidAvailable ? "-" + pid : pid };
}
{code}
> Kill command for process group id throws ExitCodeException
> ----------------------------------------------------------
>
> Key: HADOOP-11989
> URL: https://issues.apache.org/jira/browse/HADOOP-11989
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Affects Versions: 2.6.0
> Environment: debian 7
> Reporter: Chackaravarthy
>
> In the environment where setsid available, kill command is constructed with
> single dash, which throws ExitCodeException (improper usage of command)
> {noformat}
> kill -signal_num -<process_group_id>
> {noformat}
> Encountered this issue due to YARN-3561
> Kill command need to be constructed with double dash (--) which means "end of
> command options" i.e. it tells ssh command not to try to parse what comes
> after command line options. It should be constructed as follows :
> {noformat}
> kill -signal_num -- -<process_group_id>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)