-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Set correct permissions for /usr/share/logstash on pkg installs #12782
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
Conversation
d69b676 to
4327dc1
Compare
andsel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a logstash clone of this branch, I've tried with:
> rake artifact:deb
> multipass mount build/ ubuntu-lts
> multipass shell ubuntu-lts
> sudo dpkg -i logstash-7.12.0-amd64.deb
listing the contents of /usr/share/logstash:
ubuntu@ubuntu-lts:~$ ll /usr/share/logstash/
total 512
drwxr-xr-x 12 logstash logstash 4096 Mar 30 10:26 ./
drwxr-xr-x 114 root root 4096 Mar 25 15:41 ../
-rw-r--r-- 1 logstash logstash 2276 Mar 18 06:08 CONTRIBUTORS
so the directory doesn't seems to have the expects owner
andsel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've retried, the PR LGTM and works.
I've used an old deb package.
|
Jenkins test this please |
2 similar comments
|
Jenkins test this please |
|
Jenkins test this please |
…tic#12782) This PR sets correct ownership of /usr/share/logstash on DEB & RPM installs, following FHS guidelines. Closes: elastic#12771 (cherry picked from commit c4cb8f4)
…tic#12782) This PR sets correct ownership of /usr/share/logstash on DEB & RPM installs, following FHS guidelines. Closes: elastic#12771 (cherry picked from commit c4cb8f4)
Recent versions of bundler (> 2.2.3) have changed the resolution to resolve for the specific running platform, using the specific platform triple, such as `universal-java-1.8`, rather than `java`, as was previously the case, meaning that the 'PLATFORMS` section of the `Gemfile.lock` will change from: ``` PLATFORMS java ``` after: ``` PLATFORMS universal-java-1.8 ``` At runtime, unless bundler is run in frozen mode, this value is resolved again at runtime, and depending on whether the platform being run in matches that being built on, `Gemfile.lock` is resolved to match the running platform - which now causes a runtime error when running Logstash as a service, as the running application no longer has write permission on `Gemfile.lock` after elastic#12782. While this should fix elastic#12818, we should look into a permanent solution to enable us to keep up with bundler updates.
…hanges (#13015) This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. ## Release notes * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment
…malize" platform on plugin changes Backport PR #13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…d "normalize" platform on plugin changes Backport PR elastic#13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…d "normalize" platform on plugin changes Backport PR elastic#13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…nd "normalize" platform on plugin changes Backport PR elastic#13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
#13141) * Backport PR #13015 to 7.15: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes Backport PR #13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb) * Remove code pinning bundler to `~> 1.17` Also updates lockfile to update `BUNDLED WITH` to latest
#13140) * Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes Backport PR #13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb) * Remove code pinning bundler to ~> 1.17
Release notes
Fix package install permissions of /usr/share/logstash
What does this PR do?
This PR fixes the the permissions of (RPM, DEB) for /usr/share/logstash.
Why is it important/What is the impact to the user?
Ensures /usr/share/logstash has the appropriate ownership as per the FHS. Also ensures the daemon cannot modify files it needs to run.
Checklist
[ ] 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)How to test this PR locally
Related issues