You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ranjith Mandala <ra...@gmail.com> on 2016/09/17 22:14:38 UTC

Commons Exec with [exec]: {127=Process exited with an error: 127 (Exit value: 127)}

On Sat, Sep 17, 2016 at 3:12 PM, Ranjith Mandala <ra...@gmail.com> wrote:
> Hi,
>
> I am trying to use the below command, but fails with Exit code 127.
> Any help is appreciated.
>
> String command = "su -l ambari-qa -c 'hdfs dfs -ls /'
>
> CommandLine cmdLine = CommandLine.parse(command);
>
> DefaultExecutor executor = new DefaultExecutor();
>
> executor.execute();
>
> {127=Process exited with an error: 127 (Exit value: 127)}
>
> Simple command like hdfs dfs -ls / works fine but the above does not work.
>
> Thanks,
> Ranjith.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: Commons Exec with [exec]: {127=Process exited with an error: 127 (Exit value: 127)}

Posted by Ranjith Mandala <ra...@gmail.com>.
I did but its still the same issue. Any recommendation on how to construct
the below command?

On Saturday, September 17, 2016, Paulo Roberto Massa Cereda <
cereda.paulo@gmail.com> wrote:

> 'ello,
>
> I'd try building the command arguments through a sequence of
> addArgument(...) calls instead of relying on parse(...), which could be
> very tricky (mainly due to quoting).
>
> Best,
>
> Paulo
>
> Em 17-09-2016 19:14, Ranjith Mandala escreveu:
>
>> On Sat, Sep 17, 2016 at 3:12 PM, Ranjith Mandala <ra...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I am trying to use the below command, but fails with Exit code 127.
>>> Any help is appreciated.
>>>
>>> String command = "su -l ambari-qa -c 'hdfs dfs -ls /'
>>>
>>> CommandLine cmdLine = CommandLine.parse(command);
>>>
>>> DefaultExecutor executor = new DefaultExecutor();
>>>
>>> executor.execute();
>>>
>>> {127=Process exited with an error: 127 (Exit value: 127)}
>>>
>>> Simple command like hdfs dfs -ls / works fine but the above does not
>>> work.
>>>
>>> Thanks,
>>> Ranjith.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: Commons Exec with [exec]: {127=Process exited with an error: 127 (Exit value: 127)}

Posted by Paulo Roberto Massa Cereda <ce...@gmail.com>.
'ello,

I'd try building the command arguments through a sequence of 
addArgument(...) calls instead of relying on parse(...), which could be 
very tricky (mainly due to quoting).

Best,

Paulo

Em 17-09-2016 19:14, Ranjith Mandala escreveu:
> On Sat, Sep 17, 2016 at 3:12 PM, Ranjith Mandala <ra...@gmail.com> wrote:
>> Hi,
>>
>> I am trying to use the below command, but fails with Exit code 127.
>> Any help is appreciated.
>>
>> String command = "su -l ambari-qa -c 'hdfs dfs -ls /'
>>
>> CommandLine cmdLine = CommandLine.parse(command);
>>
>> DefaultExecutor executor = new DefaultExecutor();
>>
>> executor.execute();
>>
>> {127=Process exited with an error: 127 (Exit value: 127)}
>>
>> Simple command like hdfs dfs -ls / works fine but the above does not work.
>>
>> Thanks,
>> Ranjith.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org