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

Conversation

f-galland
Copy link
Member

Description

This PR adds OPENSEARCH_TMPDIR environment variable to the wazuh-indexer.service systemd unit and has it pointing to /var/log/wazuh-indexer/tmp such that /tmp and /var/tmp mount options such as noexec don't affect the service's initialization.

Issues Resolved

Resolves: wazuh/wazuh-packages#1539

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@f-galland f-galland self-assigned this May 21, 2024
@f-galland
Copy link
Member Author

Tested and working as expected:

[root@alma8 ~]# ls -l /var/log/wazuh-indexer/ | grep tmp
drwxr-x---. 2 wazuh-indexer wazuh-indexer      6 May 21 11:58 tmp


[root@alma8 ~]# systemctl status wazuh-indexer.service --no-pager
● wazuh-indexer.service - wazuh-indexer
   Loaded: loaded (/usr/lib/systemd/system/wazuh-indexer.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2024-05-21 11:58:20 -03; 7min ago
     Docs: https://documentation.wazuh.com
 Main PID: 10418 (java)
    Tasks: 66 (limit: 23148)
   Memory: 1.3G
   CGroup: /system.slice/wazuh-indexer.service
           └─10418 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch …

May 21 11:58:12 alma8 systemd-entrypoint[10418]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/wazuh-index…h-2.13.0.jar)
May 21 11:58:12 alma8 systemd-entrypoint[10418]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
May 21 11:58:12 alma8 systemd-entrypoint[10418]: WARNING: System::setSecurityManager will be removed in a future release
May 21 11:58:13 alma8 systemd-entrypoint[10418]: May 21, 2024 11:58:13 AM sun.util.locale.provider.LocaleProviderAdapter <clinit>
May 21 11:58:13 alma8 systemd-entrypoint[10418]: WARNING: COMPAT locale provider will be removed in a future release
May 21 11:58:13 alma8 systemd-entrypoint[10418]: WARNING: A terminally deprecated method in java.lang.System has been called
May 21 11:58:13 alma8 systemd-entrypoint[10418]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:/usr/share/wazuh-indexer…h-2.13.0.jar)
May 21 11:58:13 alma8 systemd-entrypoint[10418]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security
May 21 11:58:13 alma8 systemd-entrypoint[10418]: WARNING: System::setSecurityManager will be removed in a future release
May 21 11:58:20 alma8 systemd[1]: Started wazuh-indexer.
Hint: Some lines were ellipsized, use -l to show in full.


[root@alma8 ~]# systemctl cat wazuh-indexer.service --no-pager | grep OPENSEARCH_TMPDIR
Environment=OPENSEARCH_TMPDIR=/var/log/wazuh-indexer/tmp

@f-galland f-galland marked this pull request as ready for review May 21, 2024 15:07
@f-galland f-galland requested a review from a team as a code owner May 21, 2024 15:07
@AlexRuiz7 AlexRuiz7 merged commit 5201e48 into 4.9.0 May 21, 2024
12 checks passed
@AlexRuiz7 AlexRuiz7 deleted the ci/wazuh-packages-1539-tmp-noexec branch May 21, 2024 16:21
AlexRuiz7 pushed a commit that referenced this pull request Jun 28, 2024
AlexRuiz7 pushed a commit that referenced this pull request Aug 20, 2024
AlexRuiz7 pushed a commit that referenced this pull request Sep 9, 2024
AlexRuiz7 pushed a commit that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation of wazuh-indexer fails if the noexec flag is set on the /tmp directory
2 participants