Systemd service from tar - ES_TMPDIR directory does not exist

Having an issue with service start. OpenSearch 1.3 returning error ERROR: Temporary file directory [${ES_TMPDIR}] does not exist or is not accessible on service start.

This is my systemd service file:
cat /etc/systemd/system/opensearch-tar.service

[Unit]
Description=Opensearch
Documentation=https://opensearch.org/docs/latest
Requires=network.target remote-fs.target
After=network.target remote-fs.target
ConditionPathExists=/usr/share/opensearch-1.3.0
ConditionPathExists=/data/OpenSearch
[Service]
RuntimeDirectory=opensearch
# PrivateTmp=true

User=opensearch
Group=opensearch
Environment=OPENSEARCH_HOME=/usr/share/opensearch-1.3.0
Environment=OPENSEARCH_PATH_CONF=/etc/opensearch
WorkingDirectory=/usr/share/opensearch-1.3.0

ExecStart=/usr/share/opensearch-1.3.0/bin/opensearch


# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65535

# Specifies the maximum number of processes
LimitNPROC=4096

# Specifies the maximum size of virtual memory
LimitAS=infinity

# Specifies the maximum file size
LimitFSIZE=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group
KillMode=process

# Java process is never killed
SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143

# Allow a slow startup before the systemd notifier module kicks in to extend the timeout
TimeoutStartSec=75

[Install]
WantedBy=multi-user.target

Same issue even if I set the variable with

Environment=ES_TMPDIR=/tmp

I got an idea and it looks like it works.

Problem was with old jvm.options (copied from source) and with permission to certs files.

1 Like