# Job for elasticsearch.service failed because the control process exited with error code

**URL:** https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831
**Category:** Elasticsearch
**Created:** [November 30, 2017, 8:34pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831 "2017-11-30T20:34:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [November 30, 2017, 8:34pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/1 "2017-11-30T20:34:01Z")

</div>

root@d-gp2-es46-1:~# service elasticsearch start  
Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details.  
root@d-gp2-es46-1:~# service elasticsearch status

- elasticsearch.service - Elasticsearch  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)  
Active: failed (Result: exit-code) since Thu 2017-11-30 17:09:48 UTC; 3s ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Process: 29382 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=203/EXEC)  
Main PID: 4426 (code=exited, status=143)

Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: Starting Elasticsearch...  
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Control process exited, code=exited status=203  
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: Failed to start Elasticsearch.  
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Unit entered failed state.  
Nov 30 17:09:48 d-gp2-es46-1 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [November 30, 2017, 8:34pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/2 "2017-11-30T20:34:59Z")

</div>

Upgrading from 5.6.1 to 6.0.0. I install and when trying to start elasticsearch, it fails. Any ideas why?

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [November 30, 2017, 8:36pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/3 "2017-11-30T20:36:12Z")

</div>

This file exists in 5.6.1 but after installing 6.0.0 on Ubuntu 16.04 .... it does not exist anymore.

/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [November 30, 2017, 8:55pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/4 "2017-11-30T20:55:36Z")

</div>

-- vi /usr/lib/systemd/system/elasticsearch.service ... make the below changes for it to startup.  
[Service]  
LimitMEMLOCK=infinity  
Environment=ES\_HOME=/usr/share/elasticsearch  
Environment=CONF\_DIR=/etc/elasticsearch  
Environment=DATA\_DIR=/data/elasticsearch  
Environment=LOG\_DIR=/var/log/elasticsearch  
Environment=PID\_DIR=/var/run/elasticsearch  
EnvironmentFile=-/etc/default/elasticsearch  
#ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec  
ExecStart=/usr/share/elasticsearch/bin/elasticsearch   
-p ${PID\_DIR}/elasticsearch.pid   
--quiet   
-Epath.logs=${LOG\_DIR}   
-Epath.data=${DATA\_DIR}

# Specifies the maximum number of processes

LimitNPROC=4096

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [December 1, 2017, 3:19am UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/5 "2017-12-01T03:19:57Z")

</div>

> This file exists in 5.6.1 but after installing 6.0.0 on Ubuntu 16.04 .... it does not exist anymore.

That is correct. We no longer use this file in 6.0.0.  
The core issue you have is that your `elasticsearch.service` file still refers to it (although you've since resolved that).

It is likely that you edited that `elasticsearch.service` at some point in the past, so when you upgraded your elasticsearch install, the package manager was unable to reconcile the changes in the .deb with your local installation.  
Even though you have worked around this issue, you should check the logs from your upgrade because it is possible that you have missed other installation steps that could be important.

Please see the first half of this thread:

> [@Cant start ES after update from 5.6.2 to 6.0](https://discuss.elastic.co/t/cant-start-es-after-update-from-5-6-2-to-6-0/108843/4):
>
> This is the key log line. We do not have an ExecStartPre entry in 6.0.0 yet clearly your unit file still refers to one after the upgrade. This means you still have an old 5.x unit file and the upgrade did not replace the unit file with the 6.0.0 unit file. Maybe you edited the unit file (don’t do that!) and when you upgraded the package installer gave you a .rpmnew. You need to use the 6.0.0 unit file. Try to test changes to your production system in a staging environment first.

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [December 1, 2017, 3:37pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/6 "2017-12-01T15:37:18Z")

</div>

The only change I made was the following that is documented on elasticsearch's website. Is there another way to be able to set "bootstrap.memory\_lock: true" in the config file and have it start up?

[https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html)

-- vi /usr/lib/systemd/system/elasticsearch.service  
[Service]  
LimitMEMLOCK=infinity

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [December 1, 2017, 3:38pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/7 "2017-12-01T15:38:52Z")

</div>

I see in the doc it says to put it in the following file "/etc/systemd/system/elasticsearch.service.d/override.conf" ... i'll give that a try.

---

<div class="post-metadata">

### Author: ![kyle\_che](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kyle\_che](https://discuss.elastic.co/u/kyle_che)
#### Post date: [December 5, 2017, 9:26pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/8 "2017-12-05T21:26:35Z")

</div>

so i was misinformed by someone at work and by updating that file with the following command ... it works fine for upgrading.

systemctl edit elasticsearch

[Service]  
LimitMEMLOCK=infinity

---

<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: [January 2, 2018, 9:27pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code/109831/9 "2018-01-02T21:27:08Z")

</div>

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