Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start/stop script does not wait until openHAB2 is really up and running #258

Closed
thopiekar opened this issue Jul 31, 2016 · 2 comments
Closed

Comments

@thopiekar
Copy link
Member

On desktop computers this problem does not occur, but when launching openHAB2 here on my QNAP NAS I noticed the following.
When starting openHAB2 with the script (that is also used in the RPi docs) the script is not waiting until the service is really up. That means to me:

  • All extensions are loaded and running
  • HTTP and HTTPS services are ready to be used

The QNAP is able to wait for a service to be turned on. The result is at the moment that if you enable the service, that a "open" button appears really quickly. Clicking on it will show a eg. "service not available" message.
appcenter

Same for the "stop" script. In theory you are able to start the service again right after stopping it, while openHAB2 is still shutting down. Currently I'm doing checks whether OPENHAB_HTTP_PORT or OPENHAB_HTTP_PORT are still being used, before rerunning openHAB2.

The scripts I mentioned above:
${QPKG_DISTRIBUTION}/runtime/karaf/bin/[start, stop]

Was not sure where this problem actually belongs to, so added it here first.

Regards

@thopiekar thopiekar changed the title Start script does not wait until openHAB2 is really up and running Start/stop script does not wait until openHAB2 is really up and running Jul 31, 2016
@kaikreuzer
Copy link
Member

These scripts are part of Karaf, not openHAB and they launch a service in the background, which is an operation that has to return quickly and not block.

Once eclipse-archived/smarthome#1896 is implemented, we could add a service that writes a file to the filesystem to indicate that the HTTP server and all bundles are up and running. You could then check for the existence of this file in your scripts.

@thopiekar
Copy link
Member Author

Great! Thank you for the info 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants