Closed joschi closed 7 years ago
@mhutter You can find the systemd unit file at https://github.com/Graylog2/fpm-recipes/blob/master/recipes/graylog-server/files/systemd.service
@joschi Thanks! Looks like I'll have to work on my GitHub-search-fu
@mhutter Thanks for the report! Does this introduce an implicit dependency on a MongoDB system package? What happens if there is no mongod.service
present?
We decided to not depend on Elasticsearch and MongoDB packages to make the OS packages more flexible.
@bernd good point, I'll investigate if there is a way to fix the order without breaking if mongod.service
is missing
Closing this due to inactivity. Please re-open if you have any updates. Thank you!
This is still an issue .. my server is not starting on reboot due to this problem too
These two settings expect a space-separated list of unit names. They configure ordering dependencies between units. If a unit foo.service contains a setting Before=bar.service and both units are being started, bar.service's start-up is delayed until foo.service has finished starting up. Note that this setting is independent of and orthogonal to the requirement dependencies as configured by Requires=, Wants= or BindsTo=. It is a common pattern to include a unit name in both the After= and Requires= options, in which case the unit listed will be started before the unit that is configured with these options
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=
AFAIK Wants
+ After
should be the way
@drAlberT You can create a systemd snipped in /etc/systemd/system/graylog-server.service.d/
to change the Graylog server's systemd config without touching the original files.
We didn't add an explicit MongoDB dependency because the systemd service might be named differently depending on the Linux distribution you are using and our DEB and RPM files are not tied to any distribution.
OK, I already did then .. thanks
From @mhutter on November 9, 2016 14:52
When rebooting a server, it is possible for Graylog2 to crash on boot due to MongoDB not being available yet.
I would have sent a PR but I could not find the unit file in any of the Graylog Repos.
Expected Behavior
Graylog starts correctly after a reboot :-)
Current Behavior
Graylog crashes during start after a reboot
Possible Solution
in graylog-server.service, add the following:
Steps to Reproduce (for bugs)
Your Environment
Copied from original issue: Graylog2/graylog2-server#3074