Sudo service start throwing error as /home/ec2-user/elasticsearch-7.5.2/bin/elasticsearch: Perm... denied

I installed elasticsearch 7.5.2 in AWS EC2 linux. I created required file in /etc/init.d/elasticsearch and added elasticsearch and group to this instance. Provided +x permissions to user.

However, when I am trying to do sudo service elasticsearch start and I getting an error that look like below.

Any help here will be greatly appreciated.

elasticsearch.service - LSB: This service manages the elasticsearch daemon
Loaded: loaded (/etc/rc.d/init.d/elasticsearch; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2020-02-01 18:33:25 UTC; 5min ago
Docs: man:systemd-sysv-generator(8)
Process: 18971 ExecStart=/etc/rc.d/init.d/elasticsearch start (code=exited, status=1/FAILURE)

xxx.compute.internal systemd[1]: Starting LSB: This service manages the elasticsearch daemon...
xxx.compute.internal runuser[18979]: pam_limits(runuser:session): invalid line '* memlock unlimited' - skipped
xxx.compute.internal runuser[18979]: pam_unix(runuser:session): session opened for user elasticsearch by (uid=0)
xxx.compute.internal elasticsearch[18971]: Starting elasticsearch: bash: /home/ec2-user/elasticsearch-7.5.2/bin/xxx
xxx.compute.internal runuser[18979]: pam_unix(runuser:session): session closed for user elasticsearch
xxx.compute.internal elasticsearch[18971]: [FAILED]
xxx.compute.internal systemd[1]: elasticsearch.service: control process exited, code=exited status=1
xxx.compute.internal systemd[1]: Failed to start LSB: This service manages the elasticsearch daemon.
xxx.compute.internal systemd[1]: Unit elasticsearch.service entered failed state.
xxx.compute.internal systemd[1]: elasticsearch.service failed.

You appear to have installed Elasticsearch on a non-standard path (/home/...). Please check if all elements of the/home/ec2-user/elasticsearch-7.5.2/bin/elasticsearch path have the executable bit set. Please also ensure that the /home directory is mounted without the noexec mount option.

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