The*_*nor 6 osgi io-redirection apache-karaf karaf
我使用$KARAF_HOME/bin/startCentOS 6.5 在服务器模式下启动了Apache Karaf 3.0.0 .然后我想运行几个命令$KARAF_HOME/bin/client并捕获这些命令的输出,以确保命令成功运行.输出确实在我的控制台上吐出,但我永远无法将其重定向到文件中.好像Karaf没有向输出流或错误流写任何内容.我尝试了以下方法:
[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
Run Code Online (Sandbox Code Playgroud)
没有写入文件bundleList.管道输出似乎也没有帮助.
我能够在 Karaf 版本 3.0.2 中捕获客户端输出。
user@hostname:~$ client bundle:list > bundleinfo.txt
这会导致控制台上出现以下调试信息:
2053 [sshd-SshClient[36c8e545]-nio2-thread-2] 警告 org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - 服务器位于 [/0.0.0.0:8101, DSA, xx:xx:xx:xx:xx: xx:xx:c 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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2407 次 |
| 最近记录: |