-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Provide systemd unit file #3606
Comments
In the meantime, you can use pleaserun to generate this:
|
Solving this I think will require packages that target specific OS distros and versions. We don't have this today, but will think about how to solve it. |
Thanks! |
So, this verifies why a logstash systemd Unit file doesn't exist. Someone must have done something very original to enable standard "systemctl enable/disable/start/restart/stop logstash.service" to perform without a Unit file. Unless the magic is somehow not in the logstash codebase and a new feature in systemd I'm not aware of (auto support of initV by scanning /etc/init.d/ and simulating Unit files?) TIA. |
Systemd has magic to have scripts in /etc/init.d/xxx appear implicitly as systemd services so they can be controlled from the normal Hope this helps explain. |
@jordansissel systemd-sysv-generator generates on the fly unit files. However because of a design decision in systemd starting logstash doesn't work if logstash was not cleanly stopped (meaning through systemd stop). Reproduce with (on a systemd enabled machine):
The reasons for this is that 'systemd-sysv-generator' by default puts "RemainAfterExit=yes". While it should be 'RemainAfterExit=no' for the [Service] block. An override systemd section file can be found at https://gist.github.com/rgevaert/94094e94ffb420ab84a6 Here is a reference to a bugreport in discussing why systemd behaves this way. systemd/systemd#1211 |
@rgevaert Thank you for pointing in the right direction |
Separate packages should not be required: common practice seems to be to just provide both an init script and a unit file. systemctl will ignore the init script if a unit file is present. Distributions that don't have systemd will ignore the unit file |
If you have trouble writing .service file you can take https://github.com/guardian/machine-images/blob/master/packer/resources/features/elk-stack/systemd-logstash.service as an example. But this really belongs to both upstream and packages. |
@zabbal Nice job, though the .service file should not require elasticsearch.service since not all implementations of Logstash use the elasticsearch plugins for input or output. I agree that this needs to be included in the DEB and RPM packages. Many, if not all, major distributions used in the Enterprise have switched over the SystemD for service management. |
due to #4420 systemd might report a crashing logstash process as |
#4420 has been closed. |
It would be nice to have logstash install via systemd. At least for the sake of consistency with the other products (beats, elasticsearch, kibana). |
Fixed in #5341 available in 5.0.0-alpha3 |
Would be nice if you could provide a systemd unit file in addition to the SysV and Upstart init scripts. Especially now that Debian 8 has moved to systemd by default.
The text was updated successfully, but these errors were encountered: