# Why doesn’t logstash run as a deamon?

**URL:** <https://discuss.elastic.co/t/why-doesn-t-logstash-run-as-a-deamon/121490>\
**Category:** Logstash\
**Created:** [February 26, 2018, 1:08pm UTC](https://discuss.elastic.co/t/why-doesn-t-logstash-run-as-a-deamon/121490 "2018-02-26T13:08:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PerPer](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PerPer](https://discuss.elastic.co/u/PerPer)\
**Post date:** [February 26, 2018, 1:08pm UTC](https://discuss.elastic.co/t/why-doesn-t-logstash-run-as-a-deamon/121490/1 "2018-02-26T13:08:16Z")

</div>

Hi

Why doesn’t logstash run as a deamon?

I am trying to run logstash on Xubuntu in VM in VMware Workstation. I can start logstash in command prompt and make it use a simple configuration.conf as expected. One that takes stdin and sends to stdout.

per@logstash\_1:/usr/share/logstash/bin$ sudo ./logstash --path.settings /etc/logstash

But I can not start it as a deamon:

sudo systemctl start logstash.service

Logstash keeps starting and stopping and uses a lot of CPU resources. These are the last entries in syslog:

Feb 26 13:15:21 logstash\_1 systemd[1]: logstash.service: Failed with result 'exit-code'.  
Feb 26 13:15:21 logstash\_1 systemd[1]: logstash.service: Service hold-off time over, scheduling restart.  
Feb 26 13:15:21 logstash\_1 systemd[1]: Stopped logstash.  
Feb 26 13:15:21 logstash\_1 systemd[1]: Started logstash.

Logstash has stopped making entries into logstash-plain.log. Why?  
That makes it hard to progress.

I have the suspicion that logstash cannot find /etc/logstash/logstash.yml because I have seen this message earlier:

WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console

And this is because logstash dosnt get the --path.settings /etc/logstash option set.

I have put logstash in root group:

logstash : logstash root

Logstash version:

./logstash –version  
logstash 6.2.2

Logstash environment:

per@logServer\_4:/usr/share/logstash/bin$ sudo -Hu logstash env  
TERM=xterm  
LS\_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:…  
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin  
LANG=en\_US.UTF-8  
HOME=/usr/share/logstash  
LANGUAGE=en\_US  
DISPLAY=:0.0  
XAUTHORITY=/home/per/.Xauthority  
COLORTERM=xfce4-terminal  
MAIL=/var/mail/logstash  
LOGNAME=logstash  
USER=logstash  
USERNAME=logstash  
SHELL=/usr/sbin/nologin  
SUDO\_COMMAND=/usr/bin/env  
SUDO\_USER=per  
SUDO\_UID=1000  
SUDO\_GID=1000

Linux version:

per@logstash\_1:~$ cat /proc/version  
Linux version 4.4.0-116-generic (buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018

Java version:

per@logstash\_1:~$ java -version  
openjdk version "1.8.0\_151"  
OpenJDK Runtime Environment (build 1.8.0\_151-8u151-b12-0ubuntu0.16.04.2-b12)  
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)  
per@logstash\_1:~$

---

<div class="post-metadata">

**Author:** ![PerPer](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PerPer](https://discuss.elastic.co/u/PerPer)\
**Post date:** [February 27, 2018, 7:33am UTC](https://discuss.elastic.co/t/why-doesn-t-logstash-run-as-a-deamon/121490/2 "2018-02-27T07:33:56Z")

</div>

Solved. It was simply a permission issue. Hurray.  
I am newbie and this forced me to check all the start up files and it all looked fine.  
This post did not say what to do but pointed me to the permission as a possible issue:

> [@"service logstash start" does not work](https://discuss.elastic.co/t/service-logstash-start-does-not-work/83002):
>
> Hi, I have Ubuntu 16.10 and the latest Logstash installed. Running Logstash manually with /usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash" works just fine but I'm unable to run it as a service. Any help would be greatly appreciated. Thanks, X

If anyone want to know what to change, please notify me. 🙂

---

<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:** [March 27, 2018, 7:34am UTC](https://discuss.elastic.co/t/why-doesn-t-logstash-run-as-a-deamon/121490/3 "2018-03-27T07:34:23Z")

</div>

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