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

Remove pleaserun dependency and related files #12487

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

roaksoax
Copy link
Contributor

@roaksoax roaksoax commented Nov 30, 2020

What does this PR do?

This PR removes the bundling of the pleaserun library and the scripts that make use of it to modify the service units on package post installation. As part of this process, it removes the file 'startup.options' which was used to create the service files.

Please refer to #12415 for the pre-requisite branch.

Why is it important/What is the impact to the user?

It is important because it removes a binary and related files that were manually creating service files (or allowing the re-creation of them), when this service files are meant to be provided by the packaging and managed by the system.

This removes the likelihood of providing ways for the user to break their system.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

To test:

  1. Build the package:
$ sudo apt-get install openjdk-8-jdk
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
$ curl -sSL https://get.rvm.io | bash -s stable --ruby
$ source /home/ubuntu/.rvm/scripts/rvm
$ rvm install jruby-9.2.13.0
$ rvm --default use jruby-9.2.13.0
$ ./gradlew installDefaultGems
$ rake artifact:deb
  1. Install the created artifact (deb/rpm)
  2. Ensure it has a systemd file, default file and/or sysv file.

Related Issues

Packages should always install systemd files under /lib/systemd/system: #10519
Remove usage of pleaserun: #12439

@roaksoax roaksoax changed the title Remove pleaserun dependency Remove pleaserun dependency and related files Nov 30, 2020
@roaksoax roaksoax self-assigned this Feb 1, 2022
@roaksoax
Copy link
Contributor Author

@andsel please review as a continuation of the previous branch.

@robbavey would like your review as well as this will potentially impact the work you are doing for JDK17 by default, at least minimally.

Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment about the vendor/jruby/bin/.jruby.module_opts, I think it's needed by the logstash-plugin utility.

# Without this when JRuby runs 'pleaserun' gem using the AdoptOpenJDK, during the post install script
# it claims that modules are not open for private introspection and suggest it's missing --add-opens
# so including these files JRuby run with modules opened to private introspection.
"vendor/jruby/bin/.jruby.java_opts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the cause of the 🔴 CI:

both fails with:

23:52:59     Failures:
23:52:59 
23:52:59       1) CLI > logstash-plugin prepare-offline-pack create a pack from a wildcard successfully create a pack
23:52:59          Failure/Error: expect(unpacked.plugins.collect(&:name)).to include(*filters)
23:52:59            expected ["logstash-filter-aggregate", "logstash-filter-anonymize", "logstash-filter-cidr", "logstash-filter-c...stash-filter-urldecode", "logstash-filter-useragent", "logstash-filter-uuid", "logstash-filter-xml"] to include "2022-03-10T22:30:59.176Z [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem" and "Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable."
23:52:59          # ./specs/cli/prepare_offline_pack_spec.rb:92:in `block in <main>'
23:52:59          # /opt/logstash/build/qa/integration/vendor/jruby/2.5.0/gems/logstash-devutils-2.3.0-java/lib/logstash/devutils/rspec/spec_helper.rb:61:in `block in <main>'
23:52:59          # ./rspec.rb:37:in `<main>'

vendor/jruby/bin/.jruby.module_opts is needed by the JRuby run from logstash-plugins

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created the deb and installed it on Debian 10, when I launched the logstash-plugins from a bash I got:

andsel@andsel-debian10:~/logstash$ /usr/share/logstash/bin/logstash-plugin list
Using bundled JDK: /usr/share/logstash/jdk
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2022-03-14T09:58:31.033Z [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable.

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

Successfully merging this pull request may close these issues.

2 participants