# Logstash will not start with /tmp mounted noexec

**URL:** <https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125>\
**Category:** Logstash\
**Created:** [January 27, 2023, 4:45pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125 "2023-01-27T16:45:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 27, 2023, 4:45pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/1 "2023-01-27T16:45:57Z")

</div>

Logstash will not start with the /tmp directory mounted as noexec on RHEL 8.6.

We fixed this with Elasticsearch. However, do not have the proper variables, guidance on how to fix this with Logstash.

Thank You For Your Help !!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 27, 2023, 5:08pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/2 "2023-01-27T17:08:32Z")

</div>

Change the value of [java.io.tmpdir](https://www.elastic.co/guide/en/logstash/current/ts-logstash.html#ts-temp-dir). I am surprised that Elastic would even consider suggesting mounting /tmp without the noexec option, it opens up all kinds of security holes.

---

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 27, 2023, 5:19pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/3 "2023-01-27T17:19:53Z")

</div>

Thank You !!  
It seems to be working with /tmp mounted as noexec  
Will post again if we have problems.

---

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 27, 2023, 7:20pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/4 "2023-01-27T19:20:09Z")

</div>

Still causing issues  
I made a directory /usr/share/logstash/tmp gave it 755 permissions and set its owner to logstash  
I added the following to /etc/logstash/jvm.options  
-Djava.io.tmpdir=/usr/share/logstash/tmp  
Cannot start logstash when /tmp is mounted no exec.

When we worked on elasticsearch with this problem we added  
Environment=ES\_TMPDIR=/usr/share/elasticsearch/tmp to  
/usr/lib/systemd/system/elasticsearch.service

Also added  
ES\_TMPDIR=/usr/share/elasticsearch/tmp to  
/etc/sysconfig/elasticsearch

Is there an equivalent to ES\_TMPDIR in Logstash ?

Thanks For Your Help !!

---

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 30, 2023, 3:00pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/5 "2023-01-30T15:00:05Z")

</div>

Any other ideas on this ?  
Logstash still wont start  
Thank You for Your Help !!

---

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 30, 2023, 3:00pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/6 "2023-01-30T15:00:42Z")

</div>

This is RHEL 8 with systemd running

---

<div class="post-metadata">

**Author:** ![chuck1](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chuck1](https://discuss.elastic.co/u/chuck1)\
**Post date:** [January 31, 2023, 7:39pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/7 "2023-01-31T19:39:53Z")

</div>

Hello,

Made a directory /usr/share/logstash/tmp with 755 permissions  
Added  
LS\_JAVA\_OPTS="-Djava.io.tmpdir="/usr/share/logstash/tmpdir="/usr/share/logstash/tmp""  
to /usr/lib/systemd/system/logstash.service  
Remounted /tmp as exec "mount -o remount,exec /tmp"  
Stopped fapolicyd  
Ran systemctl daemon-reload  
Stopped logstash  
Started fapolicyd  
Ran the following fapolicyd commands

fapolicyd-cli --file add /usr/share/logstash --trust-file logstash.trust  
fapolicyd-cli --update

Remounted /tmp as noexec "mount -o remount,noexec /tmp" (the mount point is listed as noexec in /etc/fstab)  
Restarted logstash (logstash runs)  
Rebooted VM  
Logstash started again

After another reboot, logstash started again fapolicyd enabled and "/tmp" mounted as "noexec"

---

<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:** [February 28, 2023, 7:40pm UTC](https://discuss.elastic.co/t/logstash-will-not-start-with-tmp-mounted-noexec/324125/8 "2023-02-28T19:40:48Z")

</div>

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