Skip to content

Commit

Permalink
Add OPENSEARCH_TMPDIR variable to service and create directory in pac…
Browse files Browse the repository at this point in the history
…kages accordingly (#231)
  • Loading branch information
f-galland authored and AlexRuiz7 committed Sep 9, 2024
1 parent 701190c commit 31ac9a6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Type=notify
RuntimeDirectory=wazuh-indexer
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=OPENSEARCH_SD_NOTIFY=true
Expand Down
5 changes: 5 additions & 0 deletions distribution/packages/src/deb/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@ config_dir=/etc/wazuh-indexer
data_dir=/var/lib/wazuh-indexer
log_dir=/var/log/wazuh-indexer
pid_dir=/var/run/wazuh-indexer
tmp_dir=/var/log/wazuh-indexer/tmp


# Create needed directories
mkdir -p ${tmp_dir}

# Set owner
chown -R wazuh-indexer.wazuh-indexer ${product_dir}
chown -R wazuh-indexer.wazuh-indexer ${config_dir}
chown -R wazuh-indexer.wazuh-indexer ${log_dir}
chown -R wazuh-indexer.wazuh-indexer ${data_dir}
chown -R wazuh-indexer.wazuh-indexer ${pid_dir}
chown -R wazuh-indexer.wazuh-indexer ${tmp_dir}

# Reload systemctl daemon
if command -v systemctl > /dev/null; then
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/src/rpm/wazuh-indexer.rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
%define data_dir %{_sharedstatedir}/%{name}
%define log_dir %{_localstatedir}/log/%{name}
%define pid_dir %{_localstatedir}/run/%{name}
%define tmp_dir %{log_dir}/tmp
%{!?_version: %define _version 0.0.0 }
%{!?_architecture: %define _architecture x86_64 }

Expand Down Expand Up @@ -65,6 +66,7 @@ cd %{_topdir} && pwd
# Create necessary directories
mkdir -p %{buildroot}%{pid_dir}
mkdir -p %{buildroot}%{product_dir}/plugins
mkdir -p %{buildroot}%{tmp_dir}

# Install directories/files
cp -a etc usr var %{buildroot}
Expand Down
3 changes: 2 additions & 1 deletion docker/ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ services:
context: ./../..
dockerfile: ${REPO_PATH}/docker/ci/images/Dockerfile
volumes:
- ${REPO_PATH}/scripts:/home/wazuh-indexer/scripts
- ${REPO_PATH}/packaging_scripts:/home/wazuh-indexer/packaging_scripts
- ${REPO_PATH}/artifacts:/home/wazuh-indexer/artifacts
- ${REPO_PATH}/distribution/packages/src:/home/wazuh-indexer/distribution/packages/src
- ${REPO_PATH}/buildSrc:/home/wazuh-indexer/buildSrc
entrypoint: ["tail", "-f", "/dev/null"]
user: "1000:1000"
working_dir: /home/wazuh-indexer
2 changes: 1 addition & 1 deletion packaging_scripts/upstream_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

set -e

< buildSrc/version.properties grep opensearch | grep -Eo '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}'
< buildSrc/version.properties grep opensearch | grep -Eo '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}'

0 comments on commit 31ac9a6

Please sign in to comment.