# Problem reading environment variables when starting ES

**URL:** <https://discuss.elastic.co/t/problem-reading-environment-variables-when-starting-es/97973>\
**Category:** Elasticsearch\
**Created:** [August 22, 2017, 7:52pm UTC](https://discuss.elastic.co/t/problem-reading-environment-variables-when-starting-es/97973 "2017-08-22T19:52:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellinom](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bellinom](https://discuss.elastic.co/u/bellinom)\
**Post date:** [August 22, 2017, 7:52pm UTC](https://discuss.elastic.co/t/problem-reading-environment-variables-when-starting-es/97973/1 "2017-08-22T19:52:26Z")

</div>

Hello,

I am using the [ES 5.5 reference guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) to install ElasticSearch on RHEL 7. The issue I have is when I start the elasticsearch service it show success, but checking the service status shows failure.

When I run the command the service itself is running, /usr/share/elasticsearch/bin/elasticsearch -p ${PID\_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG\_DIR} -Edefault.path.data=${DATA\_DIR} -Edefault.path.conf=/etc/elasticsearch, it fails to resolve the environment variables.

If I manually change the variables to the actual paths, it will start, but then it begins giving errors about the log4j2 paths, which I believe is also an issue with the environment variables not being read. I have tried exporting the variables above, as well as adding them to /etc/environment, but nothing helps.

Any ideas? Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 19, 2017, 7:52pm UTC](https://discuss.elastic.co/t/problem-reading-environment-variables-when-starting-es/97973/2 "2017-09-19T19:52:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
