# Elasticsearch does not load ES\_PATH\_CONF or any values that are present in sysconfig

**URL:** <https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411>\
**Category:** Elasticsearch\
**Created:** [August 4, 2022, 11:37am UTC](https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411 "2022-08-04T11:37:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nightwatch92](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nightwatch92/32/109245_2.png) [@nightwatch92](https://discuss.elastic.co/u/nightwatch92)\
**Post date:** [August 4, 2022, 11:37am UTC](https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411/1 "2022-08-04T11:37:17Z")

</div>

Hi,

ES version: 8.3.3  
OS: CENTOS 8

We are using packages to distribute our config files in custom directory for the ES service. We can't replace /etc/sysconfig/elasticsearch, because it is owned by the elasticsearch package.

I've noticed similar issues reported, but nothing was done. The main reason this happens is because in /usr/share/elasticsearch/bin/elasticsearch-env we always source /etc/sysconfig/elasticsearch. This leads that ES\_PATH\_CONF always points to /etc/elasticsearch.

Regards,  
Stan

---

<div class="post-metadata">

**Author:** ![Tsvetina\_Georgieva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsvetina_georgieva/32/78611_2.png) [@Tsvetina\_Georgieva](https://discuss.elastic.co/u/Tsvetina_Georgieva)\
**Post date:** [August 16, 2022, 12:34pm UTC](https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411/2 "2022-08-16T12:34:28Z")

</div>

I have the same problem as you. Any ideas how to fix it?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 16, 2022, 1:16pm UTC](https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411/3 "2022-08-16T13:16:07Z")

</div>

This is expected.

If you installed using the `.rpm` package you will need to edit the file `/etc/sysconfig/elasticsearch` to change the value of `ES_PATH_CONF`, this is [documented here](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#config-files-location).

> For the package distributions, the config directory location defaults to `/etc/elasticsearch` . The location of the config directory can also be changed via the `ES_PATH_CONF` environment variable, but note that setting this in your shell is not sufficient. Instead, this variable is sourced from `/etc/default/elasticsearch` (for the Debian package) and `/etc/sysconfig/elasticsearch` (for the RPM package). **You will need to edit the `ES_PATH_CONF=/etc/elasticsearch` entry in one of these files accordingly to change the config directory location**.

This comes from the service file that has this line:

```auto
EnvironmentFile=-/etc/sysconfig/elasticsearch

```

So, to change the value of `ES_PATH_CONF` while using the package distribution you will need to edit the `elasticsearch` file inside `/etc/sysconfig` or edit the `/usr/lib/systemd/system/elasticsearch.service` systemd service file.

You can also create a different systemd service file and use it to start your elasticsearch service.

---

<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 13, 2022, 1:16pm UTC](https://discuss.elastic.co/t/elasticsearch-does-not-load-es-path-conf-or-any-values-that-are-present-in-sysconfig/311411/4 "2022-09-13T13:16:21Z")

</div>

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