08.11.2012 13:07, Victor Antonovich wrote:

> Thanks for the response. I asked this question because I have some
> problem with using admin:connect command programmatically through
> org.apache.felix.service.command.CommandProcessor. Command execution
> just hangs with "Password:" output in log file. But same command
> manually entered in Karaf Shell works well without password prompting.
> Is this expected behaviour? What I should do to programmatically
> connect to instance using admin:connect command?

Found solution and it's simple. In case of executing admin:connect
command using CommandProcessor service, CommandSession SSH_AUTH_SOCK
property should be set, i.e. for user "karaf":

> CommandProcessor commandProcessor =
getOsgiService(CommandProcessor.class);
> CommandSession commandSession = commandProcessor.createSession(System.in,
                printStream, System.err);
> commandSession.put("SSH_AUTH_SOCK", "local:karaf");

Regards,
Victor.

Reply via email to