Logstash 7 install error Ubuntu 18.04


I'm trying to install the ELK stack on a fresh Ubuntu 18.04 server. Elasticsearch and kibana are now working and I've moved onto Logstash but i get the following error when trying to install using apt. I am following the installation guide for deb files on the main elastic.io site.

After this operation, 294 MB of additional disk space will be used.
Selecting previously unselected package logstash.
(Reading database ... 193126 files and directories currently installed.)
Preparing to unpack .../logstash_1%3a7.0.0-1_all.deb ...
Unpacking logstash (1:7.0.0-1) ...
Setting up logstash (1:7.0.0-1) ...
Using provided startup.options file: /etc/logstash/startup.options
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.SecurityHelper to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.jruby.util.SecurityHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Errno::EBADF: Bad file descriptor - systemctl
spawn at org/jruby/RubyProcess.java:1567
spawn at org/jruby/RubyKernel.java:1632
popen_run at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:206
popen3 at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:102
execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:74
detect_systemd at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:29
detect_platform at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:24
detect at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/detector.rb:18
setup_defaults at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:153
execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:119
run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67
run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/cli.rb:114
run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132
at /usr/share/logstash/lib/systeminstall/pleasewrap.rb:35

I've no clue what the error means even after some googling so I'm posting it here for some guidance.


If you search this forum for that you would get to here.


Thanks - that got me on the path. I changed to version 8 OpenJDK and then I had to change the /etc/logstash/startup.options file to reflect that:

Override Java location


I then ran the sudo /usr/share/logstash/bin/system-install to update the install script as advised in startup.options. This threw up another error ( on bother!) which was that /etc/default/logstash was a directory - huh?

I removed it and re-ran the /usr/share/logstash/bin/system-install script and it completed without errors. I now have a working ELK stack.