From 855f27d5a5d1443b118b0bac6d1869ad98d46850 Mon Sep 17 00:00:00 2001 From: Fede Tux Date: Fri, 28 Jun 2024 14:37:30 -0300 Subject: [PATCH 1/4] Ignoring /run and /var/run from the list of packaged directories --- distribution/packages/src/rpm/wazuh-indexer.rpm.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index 61e1880c76ee1..c7ad01c35cc26 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -108,11 +108,12 @@ set -- "$@" "%%dir /usr/lib/systemd/system" set -- "$@" "%%dir /usr/lib/tmpfiles.d" set -- "$@" "%%dir /usr/share" set -- "$@" "%%dir /var" +set -- "$@" "%%dir /var/run" +set -- "$@" "%%dir /run" set -- "$@" "%%dir /var/lib" set -- "$@" "%%dir /var/log" set -- "$@" "%%dir /usr/lib/sysctl.d" set -- "$@" "%%dir /usr/lib/systemd" -set -- "$@" "%%dir /usr/lib/systemd" set -- "$@" "%{_sysconfdir}/sysconfig/%{name}" set -- "$@" "%{config_dir}/log4j2.properties" set -- "$@" "%{config_dir}/jvm.options" From 18b1217e31d6fed78a4509a4de8c7071be14b933 Mon Sep 17 00:00:00 2001 From: Fede Tux Date: Mon, 1 Jul 2024 15:18:47 -0300 Subject: [PATCH 2/4] Changing pid file dir to /var/run/wazuh-indexer --- 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 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/distribution/packages/src/common/env/wazuh-indexer b/distribution/packages/src/common/env/wazuh-indexer index 553fefc3adba7..1b6f33db8a34b 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=/run/wazuh-indexer +#PID_DIR=/var/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 ea5bf80944481..70871f9ae3004 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 /run/wazuh-indexer ]; then + if [ -d /var/run/wazuh-indexer ]; then echo -n "Deleting PID directory..." - rm -rf /run/wazuh-indexer + rm -rf /var/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 c021c7bcbb024..f9aa920e837b6 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.conf +++ b/distribution/packages/src/common/systemd/wazuh-indexer.conf @@ -1 +1 @@ -d /run/wazuh-indexer 0750 wazuh-indexer wazuh-indexer - - +d /var/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 093890ac0e79c..48e12ef78ec80 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.service +++ b/distribution/packages/src/common/systemd/wazuh-indexer.service @@ -11,7 +11,7 @@ PrivateTmp=true Environment=OPENSEARCH_HOME=/usr/share/wazuh-indexer Environment=OPENSEARCH_TMPDIR=/var/log/wazuh-indexer/tmp Environment=OPENSEARCH_PATH_CONF=${path.conf} -Environment=PID_DIR=/run/wazuh-indexer +Environment=PID_DIR=/var/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 6bc8e89d48f68..4e368dbc5bda5 100644 --- a/distribution/packages/src/deb/debmake_install.sh +++ b/distribution/packages/src/deb/debmake_install.sh @@ -24,7 +24,7 @@ product_dir="/usr/share/${name}" config_dir="/etc/${name}" # data_dir="/var/lib/${name}" # log_dir="/var/log/${name}" -pid_dir="/run/${name}" +pid_dir="/var/run/${name}" service_dir="/usr/lib/systemd/system" buildroot="${curdir}/debian/${name}" diff --git a/distribution/packages/src/rpm/init.d/wazuh-indexer b/distribution/packages/src/rpm/init.d/wazuh-indexer index 218519f204a64..75b7b7ac9756f 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="/run/wazuh-indexer" +PID_DIR="/var/run/wazuh-indexer" # Source the default env file OPENSEARCH_ENV_FILE="${path.env}" From c02f216199ac19cf213d89b7f69177d8c918ecdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Tue, 2 Jul 2024 12:43:47 +0200 Subject: [PATCH 3/4] Changing pid file dir to /run/wazuh-indexer --- 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/debian/postinst | 2 +- distribution/packages/src/rpm/init.d/wazuh-indexer | 2 +- 6 files changed, 7 insertions(+), 7 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 48e12ef78ec80..093890ac0e79c 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.service +++ b/distribution/packages/src/common/systemd/wazuh-indexer.service @@ -11,7 +11,7 @@ PrivateTmp=true Environment=OPENSEARCH_HOME=/usr/share/wazuh-indexer Environment=OPENSEARCH_TMPDIR=/var/log/wazuh-indexer/tmp 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/debian/postinst b/distribution/packages/src/deb/debian/postinst index 661d2b021be6b..4541f924534df 100644 --- a/distribution/packages/src/deb/debian/postinst +++ b/distribution/packages/src/deb/debian/postinst @@ -17,7 +17,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 tmp_dir=/var/log/wazuh-indexer/tmp 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}" From 49a7b40ac4e056ebf925d9db71133d697faee493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Tue, 2 Jul 2024 12:44:34 +0200 Subject: [PATCH 4/4] Changing pid file dir to /run/wazuh-indexer --- distribution/packages/src/deb/debmake_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/packages/src/deb/debmake_install.sh b/distribution/packages/src/deb/debmake_install.sh index 4e368dbc5bda5..6bc8e89d48f68 100644 --- a/distribution/packages/src/deb/debmake_install.sh +++ b/distribution/packages/src/deb/debmake_install.sh @@ -24,7 +24,7 @@ product_dir="/usr/share/${name}" config_dir="/etc/${name}" # data_dir="/var/lib/${name}" # log_dir="/var/log/${name}" -pid_dir="/var/run/${name}" +pid_dir="/run/${name}" service_dir="/usr/lib/systemd/system" buildroot="${curdir}/debian/${name}"