How to determine if Karaf is ready to accept commands through the "client"?

I am trying to automate the configuration of the karaf server by issuing commands through bin / client. But I have the following problems:

  • After running bin / start, I don't know how long I have to wait before karaf can start accepting commands
  • After each command via bin / client, subsequent bin / client commands fail with the message “Could not get session” for some time, it looks like the previous command is still running, and I have to wait some unpredictable amount of time to complete it.
  • After issuing the commands, I need to stop karaf. But as long as I don’t know if the last team has ended, I can’t do it.

Is there any way to ask if bin / client is ready to accept the next command or, better yet, wait in the script until this happens?

+3
source share

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


All Articles