Logstash not running own username

Hello,
I am running this command:

/usr/share/logstash/bin/logstash --debug --config.test_and_exit -f /etc/logstash/filebeat-test.conf

I know many times published this kind of issue, but I'm getting errors yet. I tried all kinds of decisions, but still have problems.

Your settings are invalid. Reason: Path "/usr/share/logstash/data/queue" must be a writable directory. It is not writable

This is my directory:

drwxr-xr-x 5 logstash logstash   4096 Feb  8 21:41 data
drwxr-xr-x 2 logstash logstash 4096 Feb  7 09:31 queue

With sudo working fine, but when I'm running without sudo, I got this kind of error.

Can anyone help me?

Thanks for advanced.

Do you have anything inside queue that is not owned by Logstash?

Did you run first with sudo before running as the logstash user? This can sometimes create files owned by the root and create some issues when starting logstash as the logstash user.

Thanks for answered, Leandro Pereira.
Inside queue

drwxr-xr-x 2 logstash logstash 4096 Feb  7 09:31 .
drwxr-xr-x 5 logstash logstash 4096 Feb  8 21:41 ..

Yes, when Logstash not running on its own user, then I was run via root.
Now I have to do it all over again?

Additional
If I run with this command:

sudo -u logstash /usr/share/logstash/bin/logstash --debug --config.test_and_exit -f /etc/logstash/filebeat-test.conf

I got

Configuration OK

With systemd was running but did not send any log to Elasticsearch but the status running. In log had

[FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit

Is it a possibility to run systemd?
Thanks for advanced.

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