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

Add OPENSEARCH_TMPDIR to systemd service #231

Merged
merged 1 commit into from
May 21, 2024
Merged
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
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,}'