# How can I start automatic Logstash? (SOLVED)

**URL:** <https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638>\
**Category:** Logstash\
**Created:** [September 3, 2015, 7:13pm UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638 "2015-09-03T19:13:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![killmasta93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/killmasta93/32/36022_2.png) [@killmasta93](https://discuss.elastic.co/u/killmasta93)\
**Post date:** [September 3, 2015, 7:13pm UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/1 "2015-09-03T19:13:20Z")

</div>

Hi,  
I was wondering how can I put logstash to start automatic when it boots up I have had no luck on putting it as a daemon maybe as service? Operating system Lubuntu

Every time Lubuntu restarts I have to run the command

```
service logstash restart

```

then it starts working logstash to get the logs from pfSense

Thank you

---

<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 3, 2015, 7:35pm UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/2 "2015-09-03T19:35:26Z")

</div>

The Logstash Debian package includes both a SysV init script and an Upstart configuration file. I would've expected Lubuntu to use Upstart in which case it should start Logstash upon system start without you having to do anything. If Lubuntu uses a SysV init you'll have to set up the symlinks to the init script with `update-rc.d logstash defaults`.

---

<div class="post-metadata">

**Author:** ![killmasta93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/killmasta93/32/36022_2.png) [@killmasta93](https://discuss.elastic.co/u/killmasta93)\
**Post date:** [September 4, 2015, 10:56pm UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/3 "2015-09-04T22:56:14Z")

</div>

Hi,  
Thank you for your reply But im somewhat lost ☹ So in therory Lubuntu should already start logstash. But Not sure why its seems that in my case it does not start.

I did these commands to install logstash

```
echo 'deb http://packages.elasticsearch.org/logstash/1.4/debianstable main' | sudo tee /etc/apt/sources.list.d/logstash.list

```

then i installed it

```
sudo apt-get update && sudo apt-get install logstash=1.4.2-1-2c0f5a1

```

Did i miss a command to start logstash? Because on start on virtual file system says its on

![](https://us1.discourse-cdn.com/elastic/original/2X/7/77ace455023db7e44afdc83e0a099e193ef25ce1.png)

Thank you

---

<div class="post-metadata">

**Author:** ![killmasta93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/killmasta93/32/36022_2.png) [@killmasta93](https://discuss.elastic.co/u/killmasta93)\
**Post date:** [September 5, 2015, 1:39am UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/4 "2015-09-05T01:39:49Z")

</div>

Hi,  
So I resolved the issue by running these 2 commands

```
chmod 755 /etc/init.d/logstash

```

then run

```
update-rc.d logstash defaults 95 10

```

and now its working flawless

Thank again

---

<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 5, 2015, 12:05pm UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/5 "2015-09-05T12:05:25Z")

</div>

> Did i miss a command to start logstash? Because on start on virtual file system says its on

Yes, but maybe Lubuntu doesn't use Upstart. Ubuntu does but Debian doesn't (by default).

Unless already addressed in Logstash 1.5 I'd say this is a bug, by the way: When the Debian package is installed on an Upstart system Logstash is started upon boot but to get that behavior on plain SysV systems you need to explicitly set up init.d symlinks.

> So I resolved the issue by running these 2 commands

> chmod 755 /etc/init.d/logstash

Okay, but it wasn't necessary to chmod the file as it already has the right permissions:

```
$ dpkg-deb -c /var/cache/apt/archives/logstash_1.4.2-1-2c0f5a1_all.deb | grep init.d
drwxrwxr-x 0/0 0 2014-06-24 14:41 ./etc/init.d/
-rwxr-xr-x 0/0 3462 2014-06-24 14:41 ./etc/init.d/logstash
-rwxr-xr-x 0/0 3366 2014-06-24 14:41 ./etc/init.d/logstash-web

```

---

<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 6, 2017, 5:29am UTC](https://discuss.elastic.co/t/how-can-i-start-automatic-logstash-solved/28638/6 "2017-07-06T05:29:59Z")

</div>


