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!