How to detect if Karaf is ready to accept commands via 'client'?

廉价感情. 提交于 2019-12-06 08:33:11

问题


I'm trying to automate the setup of karaf server by issuing commands through bin/client. But I have the following issues:

  1. After starting bin/start, I have no idea how long I need to wait before karaf can start accepting commands
  2. After each command via bin/client, the subsequent bin/client commands will fail with message 'Failed to acquire the session' for some time, it looks like the previous command is still executed and I must wait some unpredictable amount of time for it to finish.
  3. After issuing commands, I need to stop karaf. But as long as I don't know if the last command has finished, I can't do that.

Is there a way to ask if the bin/client is ready to accept next command, or, even best, wait in script until that happens?

来源:https://stackoverflow.com/questions/43066208/how-to-detect-if-karaf-is-ready-to-accept-commands-via-client

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!