# Sudo service elasticsearch start is not working

**URL:** <https://discuss.elastic.co/t/sudo-service-elasticsearch-start-is-not-working/29050>\
**Category:** Elasticsearch\
**Created:** [September 10, 2015, 4:00pm UTC](https://discuss.elastic.co/t/sudo-service-elasticsearch-start-is-not-working/29050 "2015-09-10T16:00:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navaneeth\_K\_N](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@Navaneeth\_K\_N](https://discuss.elastic.co/u/Navaneeth_K_N)\
**Post date:** [September 10, 2015, 4:00pm UTC](https://discuss.elastic.co/t/sudo-service-elasticsearch-start-is-not-working/29050/1 "2015-09-10T16:00:59Z")

</div>

I am trying to start elasticsearch using the default init script provided.

```
sudo service elasticsearch start

```

This will say `starting elasticsearch`, but does nothing. Not sure what is going wrong. So I added some log statements to the `/etc/init.d/elasticsearch`. This is what it printed.

```
sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d 
    -p /var/run/elasticsearch/elasticsearch.pid 
   --default.config=/etc/elasticsearch/elasticsearch.yml 
   --default.path.home=/usr/share/elasticsearch 
   --default.path.logs=/var/log/elasticsearch 
   --default.path.data=/var/lib/elasticsearch 
   --default.path.work=/tmp/elasticsearch 
   --default.path.conf=/etc/elasticsearch

```

When I run the above command directly, it works. But it won't work when executed via `sudo service elasticsearch start`. Not sure why is this failing. Because of this, none of the default settings from `/etc/default/elasticsearch` got picked up.

Any help would be great to fix this issue. Following shows the elasticsearch version.

```
"version" : {
    "number" : "1.7.1",
    "build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
    "build_timestamp" : "2015-07-29T09:54:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 10, 2015, 4:10pm UTC](https://discuss.elastic.co/t/sudo-service-elasticsearch-start-is-not-working/29050/2 "2015-09-10T16:10:38Z")

</div>

Anything interesting in the Elasticsearch log file? What if you attempt to start it with `sudo sh -x /etc/init.d/elasticsearch start`?

---

<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:** [July 5, 2017, 11:51pm UTC](https://discuss.elastic.co/t/sudo-service-elasticsearch-start-is-not-working/29050/3 "2017-07-05T23:51:11Z")

</div>


