Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
bgColor#000000

No Format
nopaneltrue
> java -jar lib/servicemixkaraf-client.jar --help
Apache ServiceMixFelix KernelKaraf client
  -a [address]  specify the URL to connect to
  -h [host]     specify the host to connect to
  -u [user]     specify the user name
  -p [password] specify the password
  --help        shows this help message
  [commands]    commands to run
If no commands are specified, the client will be put in an interactive mode

...

title
Panel
bgColor#000000

No Format
nopaneltrue
> java -jar lib/servicemixkaraf-client.jar 
smx@root:/> osgi/:shutdown
smx@root:/>
>

Warning

Sending direct commands from the client

The client jar

...

also supports passing command line arguments to the remote Karaf.

In order to do so, you can create a text file containing the commands and use the system console to redirect this file to the input stream:
Code Block
> echo osgi/shutdown > command.txt

> java -jar lib/
servicemix
karaf-client.jar 
< command.txt
osgi:shutdown
>
Warning

#top

Using an SSH client

You can use any standard SSH client to connect to a Karaf instance. The default port is 8101.

Code Block

> ssh -p 8101 -l 
smx
karaf localhost
smx@localhost
karaf@localhost's password: 
smx
karaf
smx@root
karaf@root:/>
Warning
titleError messages when using some ssh clients

Some SSH clients will prompt some harmless warnings when connecting to ServiceMix Kernel.
In particular, openssh 5.1p1 will display the following output:

Code Block
channel_by_id: 1: bad id: channel free
channel_input_success_failure: 1: unknown
channel_by_id: 1: bad id: channel free
channel_input_success_failure: 1: unknown

...

Code Block
remote rsh tcp://localhost:8101/ -u smxkaraf -p smxkaraf 

You can also do that in a single command line from the prompt by appending the previous ServiceMix command to the shell command:

Code Block
bin/karaf client remote rsh tcp://localhost:8101/ -u smxkaraf -p smxkaraf 

To verify that your are connected to the remote Kernel, run the following command:

...

Code Block
startLocalConsole=${karaf.startLocalConsole}
startRemoteShell=${karaf.startRemoteShell}
sshPort=8101
sshRealm=servicemixkaraf
hostKey=${karaf.base}/etc/host.key

...

The security realm used by the console when authenticating remote users is named servicemix karaf, so you can override this realm as explained in the security section.

...