Unable to execute Apache Karaf client output

I started Apache Karaf 3.0.0 in server mode using $KARAF_HOME/bin/startCentOS 6.5. Then I wanted to run several commands using $KARAF_HOME/bin/client, as well as capture the output of these commands to make sure that the commands completed successfully. The output resulted in my console, but I could never redirect it to a file. It seems that Karaf is not writing anything to the output stream or the error stream. I tried the following:

[apache-karaf-3.0.0]$ ./bin/start clean
[apache-karaf-3.0.0]$ ./bin/client "bundle:list"
Logging in as karaf
282 [pool-2-thread-3] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /0.0.0.0:8101 presented unverified key:
START LEVEL 100 , List Threshold: 50
 ID | State  | Lvl | Version                 | Name
------------------------------------------------------------------------------------
 91 | Active |  80 | 1.8.0                   | Commons Codec
 92 | Active |  80 | 2.6                     | Commons Lang
 93 | Active |  80 | 15.0.0                  | Guava: Google Core Libraries for Java

[apache-karaf-3.0.0]$ ./bin/client "bundle:list" >& bundleList
[apache-karaf-3.0.0]$ cat bundleList
null

Nothing is written to the file bundleList. It seems that output output does not help.

+4
source share
3 answers

"tac" -f Karaf 3.0.3, , -help

+4

Karaf 3.0.2.

user@hostname:~$ client bundle:list > bundleinfo.txt

:

2053 [sshd-SshClient [36c8e545] -nio2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - [/0.0.0.0:8101, DSA, xx: xx: xx: xx: : : : 2: 3a: 5a: 9b: 87: ed: e0: b2: 6a] {}: {}

.. , , bundleinfo.txt , :

user@hostname:~$ head -5 bundleinfo.txt
START LEVEL 100 , List Threshold: 50
 ID | State    | Lvl | Version                 | Name
---------------------------------------------------------------------------------------------
38 | Active   |  80 | 3.2.5.RELEASE           | Spring Security Core
39 | Active   |  80 | 1.0.0.1                 | Apache ServiceMix :: Bundles :: javax.inject
+1

Aviv, , . "bundle: list | tac -f/tmp/yourfile"

+1

Source: https://habr.com/ru/post/1532021/


All Articles