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

EveBox may start before Elasticsearch is ready when started from systemd #170

Closed
fcorneli opened this issue May 9, 2021 · 3 comments
Closed
Milestone

Comments

@fcorneli
Copy link

fcorneli commented May 9, 2021

Running Evebox as systemd service on CentOS, with elasticsearch as database, gives me an error that elasticsearch is not available upon system reboot and hence the Evebox service fails to start.
Adding to /usr/lib/systemd/system/evebox.service the following line under [Unit] solves the issue:

After=elasticsearch.service

Maybe this could be included per default?

@jasonish
Copy link
Owner

jasonish commented May 9, 2021

Not all systemd users of EveBox are using Elasticsearch. I'll have to tune the waiting for elasticsearch to become available behaviour.

@jasonish jasonish changed the title Evebox startup issue EveBox may start before Elasticsearch is ready when started from systemd May 9, 2021
@fcorneli
Copy link
Author

Not all systemd users of EveBox are using Elasticsearch.

That's why I used After instead of Requires. Hence if Elasticsearch runs on the machine, Evebox will be started after Elasticsearch (just in case Evebox actually uses Elasticsearch as data source). If Elasticsearch does not run on the machine, Evebox will also be started and After is simply not used by systemd.

But indeed, ideally Evebox can survive the fact that Elasticsearch is started after it.

@jasonish jasonish added this to the 0.14.0 milestone May 17, 2021
jasonish added a commit that referenced this issue May 19, 2021
If using Elasticsearch, wait for a successful get of the version.
This means we won't proceed until Elasticsearch is ready as well.

Related issue:
#170
@jasonish
Copy link
Owner

jasonish commented May 19, 2021

EveBox will now wait on startup for Elasticsearch to be ready. This was needed even outside of systemd. This is now in development builds. I plan a release build soon I think.

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