From 65f46e157b63c49ffe384081f6325ab5000a7ffc Mon Sep 17 00:00:00 2001 From: Federico Gustavo Galland <99492720+f-galland@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:14:50 -0300 Subject: [PATCH 1/2] Fix RPM package references to /var/run (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switch /var/run references to /run * Remove unneeded files from assembled packages (#115) * add remove files function to assemble.sh * Remove unneeded files on assembled tar packages * Remove duplicated function Fix wrong variable assignment --------- Co-authored-by: Álex Ruiz * Add missing tools and files back into Wazuh Indexer packages (#117) * add remove files function to assemble.sh * Remove unneeded files on assembled tar packages * Remove duplicated function Fix wrong variable assignment * Adding function to package Wazuh`s tools to assemble.sh * Make the files' versions follow the repo's VERSION file * Fix download of Wazuh tools for packages assembly --------- Signed-off-by: Álex Ruiz Co-authored-by: Álex Ruiz * Remove unneeded symbolic links from assembled packages (#121) * Remove reference to install_demo_configuration.sh --------- Signed-off-by: Álex Ruiz Co-authored-by: Álex Ruiz --- distribution/packages/src/common/env/wazuh-indexer | 2 +- distribution/packages/src/common/scripts/postrm | 4 ++-- distribution/packages/src/common/systemd/wazuh-indexer.conf | 2 +- .../packages/src/common/systemd/wazuh-indexer.service | 2 +- distribution/packages/src/deb/debmake_install.sh | 2 +- distribution/packages/src/rpm/init.d/wazuh-indexer | 2 +- distribution/packages/src/rpm/wazuh-indexer.rpm.spec | 4 ---- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/distribution/packages/src/common/env/wazuh-indexer b/distribution/packages/src/common/env/wazuh-indexer index 1b6f33db8a34b..553fefc3adba7 100644 --- a/distribution/packages/src/common/env/wazuh-indexer +++ b/distribution/packages/src/common/env/wazuh-indexer @@ -13,7 +13,7 @@ OPENSEARCH_PATH_CONF=${path.conf} # wazuh-indexer PID directory -#PID_DIR=/var/run/wazuh-indexer +#PID_DIR=/run/wazuh-indexer # Additional Java OPTS #OPENSEARCH_JAVA_OPTS= diff --git a/distribution/packages/src/common/scripts/postrm b/distribution/packages/src/common/scripts/postrm index 70871f9ae3004..ea5bf80944481 100644 --- a/distribution/packages/src/common/scripts/postrm +++ b/distribution/packages/src/common/scripts/postrm @@ -72,9 +72,9 @@ if [ "$REMOVE_DIRS" = "true" ]; then echo " OK" fi - if [ -d /var/run/wazuh-indexer ]; then + if [ -d /run/wazuh-indexer ]; then echo -n "Deleting PID directory..." - rm -rf /var/run/wazuh-indexer + rm -rf /run/wazuh-indexer echo " OK" fi diff --git a/distribution/packages/src/common/systemd/wazuh-indexer.conf b/distribution/packages/src/common/systemd/wazuh-indexer.conf index f9aa920e837b6..c021c7bcbb024 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.conf +++ b/distribution/packages/src/common/systemd/wazuh-indexer.conf @@ -1 +1 @@ -d /var/run/wazuh-indexer 0750 wazuh-indexer wazuh-indexer - - +d /run/wazuh-indexer 0750 wazuh-indexer wazuh-indexer - - diff --git a/distribution/packages/src/common/systemd/wazuh-indexer.service b/distribution/packages/src/common/systemd/wazuh-indexer.service index e396257a9d5cf..130f22472d2e4 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.service +++ b/distribution/packages/src/common/systemd/wazuh-indexer.service @@ -10,7 +10,7 @@ RuntimeDirectory=wazuh-indexer PrivateTmp=true Environment=OPENSEARCH_HOME=/usr/share/wazuh-indexer Environment=OPENSEARCH_PATH_CONF=${path.conf} -Environment=PID_DIR=/var/run/wazuh-indexer +Environment=PID_DIR=/run/wazuh-indexer Environment=OPENSEARCH_SD_NOTIFY=true EnvironmentFile=-${path.env} diff --git a/distribution/packages/src/deb/debmake_install.sh b/distribution/packages/src/deb/debmake_install.sh index 021a31e260d15..3e0f4141c87d0 100644 --- a/distribution/packages/src/deb/debmake_install.sh +++ b/distribution/packages/src/deb/debmake_install.sh @@ -21,7 +21,7 @@ product_dir=/usr/share/wazuh-indexer # config_dir=/etc/wazuh-indexer data_dir=/var/lib/wazuh-indexer log_dir=/var/log/wazuh-indexer -pid_dir=/var/run/wazuh-indexer +pid_dir=/run/wazuh-indexer buildroot=${curdir}/debian/wazuh-indexer # Create necessary directories diff --git a/distribution/packages/src/rpm/init.d/wazuh-indexer b/distribution/packages/src/rpm/init.d/wazuh-indexer index 75b7b7ac9756f..218519f204a64 100644 --- a/distribution/packages/src/rpm/init.d/wazuh-indexer +++ b/distribution/packages/src/rpm/init.d/wazuh-indexer @@ -39,7 +39,7 @@ MAX_OPEN_FILES=65535 MAX_MAP_COUNT=262144 OPENSEARCH_PATH_CONF="${path.conf}" -PID_DIR="/var/run/wazuh-indexer" +PID_DIR="/run/wazuh-indexer" # Source the default env file OPENSEARCH_ENV_FILE="${path.env}" diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index 28be42bbb9fc4..ca1353142bee8 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -104,10 +104,6 @@ exit 0 %post set -e -# Apply Security Settings -if [ -d %{product_dir}/plugins/opensearch-security ]; then - sh %{product_dir}/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s > %{log_dir}/install_demo_configuration.log 2>&1 -fi chown -R %{name}.%{name} %{config_dir} chown -R %{name}.%{name} %{log_dir} # Apply PerformanceAnalyzer Settings From 82f358adedb2474fb62fbf59982e7ec4b974ac54 Mon Sep 17 00:00:00 2001 From: Federico Gustavo Galland <99492720+f-galland@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:39:37 -0300 Subject: [PATCH 2/2] Removing post-install message from wazuh-indexer.rpm.spec (#131) --- .../packages/src/rpm/wazuh-indexer.rpm.spec | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index ca1353142bee8..9f89b01056993 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -132,19 +132,11 @@ if command -v systemd-tmpfiles > /dev/null; then fi # Messages -echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd" +echo "### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd" echo " sudo systemctl daemon-reload" -echo " sudo systemctl enable opensearch.service" -echo "### You can start opensearch service by executing" -echo " sudo systemctl start opensearch.service" -if [ -d %{product_dir}/plugins/opensearch-security ]; then - echo "### Create opensearch demo certificates in %{config_dir}/" - echo " See demo certs creation log in %{log_dir}/install_demo_configuration.log" -fi -echo "### Upcoming breaking change in packaging" -echo " In a future release of OpenSearch, we plan to change the permissions associated with access to installed files" -echo " If you are configuring tools that require read access to the OpenSearch configuration files, we recommend you add the user that runs these tools to the 'opensearch' group" -echo " For more information, see https://github.com/opensearch-project/opensearch-build/pull/4043" +echo " sudo systemctl enable wazuh-indexer.service" +echo "### You can start wazuh-indexer service by executing" +echo " sudo systemctl start wazuh-indexer.service" exit 0 %preun