# ElasticSearch custom Service not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712>\
**Category:** Elasticsearch\
**Created:** [May 14, 2018, 10:07am UTC](https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712 "2018-05-14T10:07:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giuseppe\_Merlo](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giuseppe\_Merlo](https://discuss.elastic.co/u/Giuseppe_Merlo)\
**Post date:** [May 14, 2018, 10:07am UTC](https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712/1 "2018-05-14T10:07:31Z")

</div>

Hi everyone!

I'm just trying to run Elasticsearch on machine startup.

I have Elasticsearch directory and execute ./elasticsearch from bin manually. I can not use elasticsearch.service and i try to make it on my own.

So, in my remote machine i created a .sh script that use cd terminal command to go to elasticsearch/bin and then execute elasticsearch.  
After this, i created a systemctl service called runElastic, i put it in /etc/systemd/system, i reloaded deamon and enabled my runElastic.service.  
If i start runElastic.service manually, it works fine! But, if i reboot my remote machine and i reconnect to it by ssh, runElastic.service crashes with this error:

```
    ● runElastic.service - Elasticsearch
   Loaded: loaded (/etc/systemd/system/runElastic.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since lun 2018-05-14 11:30:18 CEST; 54min ago
 Main PID: 1311 (code=exited, status=203/EXEC)

mag 14 11:30:18 lachesi systemd[1]: Started Elasticsearch.
mag 14 11:30:18 lachesi systemd[1]: runElastic.service: Main process exited, code=exited, status=203/EXEC
mag 14 11:30:18 lachesi systemd[1]: runElastic.service: Unit entered failed state.
mag 14 11:30:18 lachesi systemd[1]: runElastic.service: Failed with result 'exit-code'.

```

This is my runElastic.service:

```
[Unit]
Description=Elasticsearch
After=network.target network-online.target multi-user.target

[Service]
ExecStart=/home/marco/runElastic.sh
User=marco

[Install]
WantedBy=default.target multi-user.target

```

Can anyone help me? Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 15, 2018, 8:21am UTC](https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712/2 "2018-05-15T08:21:09Z")

</div>

> [@Giuseppe\_Merlo](#):
>
> I can not use elasticsearch.service and i try to make it on my own.

Why not, what happens?

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Merlo](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giuseppe\_Merlo](https://discuss.elastic.co/u/Giuseppe_Merlo)\
**Post date:** [May 15, 2018, 1:24pm UTC](https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712/3 "2018-05-15T13:24:58Z")

</div>

I suppose it points to another installation. But i was able to resolve my problem 😉

---

<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:** [June 12, 2018, 1:25pm UTC](https://discuss.elastic.co/t/elasticsearch-custom-service-not-working/131712/4 "2018-06-12T13:25:02Z")

</div>

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