Why doesn’t logstash run as a deamon?

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:~$

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:

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

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