# Logstash not running own username

**URL:** <https://discuss.elastic.co/t/logstash-not-running-own-username/305703>\
**Category:** Logstash\
**Created:** [May 26, 2022, 11:30am UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703 "2022-05-26T11:30:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bekk777](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bekk777/32/101315_2.png) [@bekk777](https://discuss.elastic.co/u/bekk777)\
**Post date:** [May 26, 2022, 11:30am UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703/1 "2022-05-26T11:30:32Z")

</div>

Hello,  
I am running this command:

```auto
/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.

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

```

This is my directory:

```auto
drwxr-xr-x 5 logstash logstash 4096 Feb 8 21:41 data

```

```auto
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.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 26, 2022, 12:12pm UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703/2 "2022-05-26T12:12:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bekk777](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bekk777/32/101315_2.png) [@bekk777](https://discuss.elastic.co/u/bekk777)\
**Post date:** [May 26, 2022, 2:30pm UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703/3 "2022-05-26T14:30:23Z")

</div>

Thanks for answered, Leandro Pereira.  
Inside `queue`

```auto
drwxr-xr-x 2 logstash logstash 4096 Feb 7 09:31 .

```

```auto
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?

---

<div class="post-metadata">

**Author:** ![bekk777](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bekk777/32/101315_2.png) [@bekk777](https://discuss.elastic.co/u/bekk777)\
**Post date:** [May 27, 2022, 7:58am UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703/4 "2022-05-27T07:58:20Z")

</div>

**Additional**  
If I run with this command:

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

```

I got

```auto
Configuration OK

```

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

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

```

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

---

<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:** [June 24, 2022, 7:59am UTC](https://discuss.elastic.co/t/logstash-not-running-own-username/305703/5 "2022-06-24T07:59:13Z")

</div>

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