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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ gem "logstash-core", :path => "./logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash-core-plugin-api"

gem "paquet", "~> 0.2"
gem "pleaserun", "~>0.0.28"
gem "rake", "~> 12"
gem "ruby-progressbar", "~> 1"
gem "logstash-output-elasticsearch", ">= 10.4.2"
Expand Down
17 changes: 0 additions & 17 deletions NOTICE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -8836,23 +8836,6 @@ You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==========
Notice for: pleaserun-0.0.32
----------

Copyright 2014 Jordan Sissel contributors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
99 changes: 0 additions & 99 deletions bin/system-install

This file was deleted.

53 changes: 0 additions & 53 deletions config/startup.options

This file was deleted.

15 changes: 6 additions & 9 deletions docs/static/setting-up-logstash.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ locations for the system:
d|

| settings
| Configuration files, including `logstash.yml`, `jvm.options`, and `startup.options`
| Configuration files, including `logstash.yml` and `jvm.options`
| `/etc/logstash`
| `path.settings`

Expand All @@ -115,6 +115,11 @@ locations for the system:
| `/var/lib/logstash`
| `path.data`

| start-up options
| File used by the Logstash daemon to define the default start-up options.
| `/etc/default/logstash`
d|

|=======================================================================

[[docker-layout]]
Expand Down Expand Up @@ -193,11 +198,3 @@ The settings files are already defined in the Logstash installation. Logstash in
Specify each flag on a separate line. All other settings in this file are
considered expert settings.
*`log4j2.properties`*:: Contains default settings for `log4j 2` library. See <<log4j2>> for more info.
*`startup.options` (Linux)*::
Contains options used by the `system-install` script in `/usr/share/logstash/bin` to build the appropriate startup
script for your system. When you install the Logstash package, the `system-install` script executes at the end of the
installation process and uses the settings specified in `startup.options` to set options such as the user, group,
service name, and service description. By default, Logstash services are installed under the user `logstash`. The `startup.options` file makes it easier for you to install multiple instances of the Logstash service. You can copy
the file and change the values for specific settings. Note that the `startup.options` file is not read at startup. If
you want to change the Logstash startup script (for example, to change the Logstash user or read from a different
configuration path), you must re-run the `system-install` script (as root) to pass in the new settings.
28 changes: 0 additions & 28 deletions lib/systeminstall/pleasewrap.rb

This file was deleted.

1 change: 0 additions & 1 deletion pkg/centos/after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ sed -i \
-e 's|# path.logs:|path.logs: /var/log/logstash|' \
-e 's|# path.data:|path.data: /var/lib/logstash|' \
/etc/logstash/logstash.yml
chmod 600 /etc/logstash/startup.options
chmod 600 /etc/default/logstash

8 changes: 7 additions & 1 deletion pkg/centos/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ if ! getent passwd logstash >/dev/null; then
-s /sbin/nologin -c "logstash" logstash
fi

# Handle upgrade: Check if old service unit exists and remove it
# Handle upgrade
## Check if old service unit exists and remove it
if [ -f /etc/systemd/system/logstash.service ]; then
rm -rf /etc/systemd/system/logstash.service || true
fi

## Check if startup.options file exists and remote it
if [ -f /etc/logstash/startup.options ]; then
rm -rf /etc/logstash/startup.options || true
fi
1 change: 0 additions & 1 deletion pkg/debian/after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ sed -i \
-e 's|# path.logs:|path.logs: /var/log/logstash|' \
-e 's|# path.data:|path.data: /var/lib/logstash|' \
/etc/logstash/logstash.yml
chmod 600 /etc/logstash/startup.options
chmod 600 /etc/default/logstash

8 changes: 7 additions & 1 deletion pkg/debian/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ if ! getent passwd logstash >/dev/null; then
-s /usr/sbin/nologin -c "LogStash Service User" logstash
fi

# Handle upgrade: Check if old service unit exists and remove it
# Handle upgrade
## Check if old service unit exists and remove it
if [ -f /etc/systemd/system/logstash.service ]; then
rm -rf /etc/systemd/system/logstash.service || true
fi

## Check if startup.options file exists and remote it
if [ -f /etc/logstash/startup.options ]; then
rm -rf /etc/logstash/startup.options || true
fi
1 change: 0 additions & 1 deletion pkg/ubuntu/after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ sed -i \
-e 's|# path.logs:|path.logs: /var/log/logstash|' \
-e 's|# path.data:|path.data: /var/lib/logstash|' \
/etc/logstash/logstash.yml
chmod 600 /etc/logstash/startup.options
chmod 600 /etc/default/logstash
8 changes: 7 additions & 1 deletion pkg/ubuntu/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ if ! getent passwd logstash >/dev/null; then
-s /usr/sbin/nologin -c "LogStash Service User" logstash
fi

# Handle upgrade: Check if old service unit exists and remove it
# Handle upgrade
## Check if old service unit exists and remove it
if [ -f /etc/systemd/system/logstash.service ]; then
rm -rf /etc/systemd/system/logstash.service || true
fi

## Check if startup.options file exists and remote it
if [ -f /etc/logstash/startup.options ]; then
rm -rf /etc/logstash/startup.options || true
fi
12 changes: 0 additions & 12 deletions rakelib/artifacts.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace "artifact" do
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-SNAPSHOT" : ""
end

## TODO: Install new service files
def package_files
[
"NOTICE.TXT",
Expand All @@ -37,7 +36,6 @@ namespace "artifact" do

"lib/bootstrap/**/*",
"lib/pluginmanager/**/*",
"lib/systeminstall/**/*",
"lib/secretstore/**/*",

"logstash-core/lib/**/*",
Expand All @@ -61,11 +59,6 @@ namespace "artifact" do
# See more in https://github.com/elastic/logstash/issues/4818
"vendor/??*/**/.mvn/**/*",

# 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.

"vendor/jruby/bin/.jruby.module_opts",
"Gemfile",
"Gemfile.lock",
"x-pack/**/*",
Expand Down Expand Up @@ -554,9 +547,6 @@ namespace "artifact" do
ensure_logstash_version_constant_defined
package_filename = "logstash#{suffix}-#{LOGSTASH_VERSION}#{PACKAGE_SUFFIX}-#{arch_suffix}.TYPE"

File.join(basedir, "config", "startup.options").tap do |path|
dir.input("#{path}=/etc/logstash")
end
File.join(basedir, "config", "jvm.options").tap do |path|
dir.input("#{path}=/etc/logstash")
end
Expand Down Expand Up @@ -592,7 +582,6 @@ namespace "artifact" do
out.attributes[:rpm_user] = "root"
out.attributes[:rpm_group] = "root"
out.attributes[:rpm_os] = "linux"
out.config_files << "/etc/logstash/startup.options"
out.config_files << "/etc/logstash/jvm.options"
out.config_files << "/etc/logstash/log4j2.properties"
out.config_files << "/etc/logstash/logstash.yml"
Expand All @@ -611,7 +600,6 @@ namespace "artifact" do
out.attributes[:deb_user] = "root"
out.attributes[:deb_group] = "root"
out.attributes[:deb_suggests] = ["java11-runtime-headless"] unless bundle_jdk
out.config_files << "/etc/logstash/startup.options"
out.config_files << "/etc/logstash/jvm.options"
out.config_files << "/etc/logstash/log4j2.properties"
out.config_files << "/etc/logstash/logstash.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ dependency,dependencyUrl,licenseOverride,copyright,sourceURL
"org.reflections:reflections:",https://github.com/ronmamo/reflections,BSD-2-Clause
"org.slf4j:slf4j-api:",http://www.slf4j.org/,MIT
"paquet:",https://github.com/elastic/logstash,Apache-2.0
"pleaserun:",https://github.com/jordansissel/pleaserun,Apache-2.0
"polyglot:",http://github.com/cjheath/polyglot,MIT
"pry:",http://pryrepl.org,MIT
"public_suffix:",https://simonecarletti.com/code/publicsuffix-ruby,MIT
Expand Down