# ES\_PATH\_CONF problem

**URL:** <https://discuss.elastic.co/t/es-path-conf-problem/142744>\
**Category:** Elasticsearch\
**Created:** [August 2, 2018, 10:43am UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744 "2018-08-02T10:43:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AurelienG](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@AurelienG](https://discuss.elastic.co/u/AurelienG)\
**Post date:** [August 2, 2018, 10:43am UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744/1 "2018-08-02T10:43:07Z")

</div>

I've seen several topics about this but none really solved my problem.  
I need to change Elasticsearch config path so I created override.conf in /etc/systemd/system/elasticsearch.service.d/ with the following lines:

```auto
[Service]
Environment=ES_HOME={{ service_home_directory }}
Environment=ES_PATH_CONF={{ service_conf_directory }}
Environment=WORK_DIR={{ service_tmp_directory }}
Environment=DATA_DIR={{ service_data_directory }}
Environment=LOG_DIR={{ service_log_directory }}
Environment=PID_DIR={{ service_systemd_directory }}
WorkingDirectory={{ service_home_directory }}

ExecStart={{ service_home_directory }}/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid

```

Removing the --quiet from the exec command worked, changing PID\_DIR too, but for other variables the process uses values set in /etc/sysconfig/elasticsearch, nothing is overriden.  
Did I miss something or do something wrong? I think the solution is very simple but I just can't find it...

Edit: if I check systemctl show elasticsearch.service I do have the correct environment variables (ES\_PATH\_CONF, WORK\_DIR, LOG\_DIR, DATA\_DIR) but if in the executed process the options are not right:

```auto
elastic+ 59979 3.9 15.9 3684404 1276456 ? Ssl 14:50 0:26 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch.k1qFeiEP -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /path/to/pid/file

```

Those JVM options are not what I have in my jvm.options, so I think the problem really is that the ES\_PATH\_CONF isn't used/overriden.

---

<div class="post-metadata">

**Author:** ![AurelienG](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@AurelienG](https://discuss.elastic.co/u/AurelienG)\
**Post date:** [August 2, 2018, 2:29pm UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744/2 "2018-08-02T14:29:38Z")

</div>

I managed to make it work by commenting out the line defining ES\_PATH\_CONF in /etc/sysconfig/elasticsearch.  
I won't mark this as solved as this isn't a real solution for me. If someone could at least tell me why ES\_PATH\_CONF in systemd doesn't override the sysconfig file, that would be great.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 3, 2018, 9:26pm UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744/3 "2018-08-03T21:26:28Z")

</div>

This is a known issue, but fixing it is a little tricky. See [https://github.com/elastic/elasticsearch/issues/28619](https://github.com/elastic/elasticsearch/issues/28619).

---

<div class="post-metadata">

**Author:** ![AurelienG](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@AurelienG](https://discuss.elastic.co/u/AurelienG)\
**Post date:** [August 7, 2018, 7:40am UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744/4 "2018-08-07T07:40:23Z")

</div>

Thanks for that link.  
Although, it doesn't seem to be the same issue. The issue you linked is about not being able to change ES\_ENV\_FILE. That wouldn't be a problem for me if the environment variables set in this file were overriden by elasticsearch.service.d/elasticsearch.conf. But the answer is indeed a solution to my problem, and that's the only solution I found too.

---

<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 4, 2018, 7:40am UTC](https://discuss.elastic.co/t/es-path-conf-problem/142744/5 "2018-09-04T07:40:28Z")

</div>

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