ElasticSearch custom Service not working

(Giuseppe Merlo) #1

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:

After=network.target network-online.target multi-user.target


WantedBy=default.target multi-user.target

Can anyone help me? Thanks a lot in advance!

(Mark Walkom) #2

Why not, what happens?

(Giuseppe Merlo) #3

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

(system) #4

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