# Pid(/var/run/logstash.pid) file is not being created

**URL:** <https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771>\
**Category:** Logstash\
**Created:** [January 6, 2017, 10:37am UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771 "2017-01-06T10:37:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blnprasad](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@blnprasad](https://discuss.elastic.co/u/blnprasad)\
**Post date:** [January 6, 2017, 10:37am UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771/1 "2017-01-06T10:37:32Z")

</div>

Hi,  
I started using latest logstash(5.0) on ubuntu16.0 version and finding that /var/run/logstash.pid is not being created.

I'm able run log stash successfully using **sysctrl start logstash.service** but pid file is not being created.

I'm using monit to monitor logstash using pid file. Can you please help me in configuration to get pid file?

Thanks,  
BLN

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [January 7, 2017, 6:11pm UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771/2 "2017-01-07T18:11:03Z")

</div>

you would have to check your startup script to see what is going on as logstash itself does not write a PID file

1. does logstash run as root or does it have access to /var/run (Probably not if it is not root) also I thought it might log the pid to /var/run/logstash/logstash.pid

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 10, 2017, 7:08am UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771/3 "2017-01-10T07:08:12Z")

</div>

I'm not sure Logstash's systemd setup uses PID files. Have a look in the unit file. Is there a PIDFile option? And do you really need Monit to monitor your process when you have systemd?

---

<div class="post-metadata">

**Author:** ![blnprasad](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@blnprasad](https://discuss.elastic.co/u/blnprasad)\
**Post date:** [January 10, 2017, 7:46am UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771/4 "2017-01-10T07:46:49Z")

</div>

There is no PIDFile option. Ideally it should honor the config file option  
LS\_PIDFILE in statup.options. I tried PIDFile option in systemd unit file  
but still it's not writing. I'm not sure about the reason.  
But if we take elastic search it still writes pid  
in /var/run/elasticsearch/elasticsearch.pid file. So i'm wondering why  
logstash has broken it in 5.0

monit is better way for us to monitor process stats(memory, cpu etc) from  
centralized location. We depend on monit and M/Monit for centralized  
monitoring of all systems in our deployment.

---

<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 7, 2017, 7:46am UTC](https://discuss.elastic.co/t/pid-var-run-logstash-pid-file-is-not-being-created/70771/5 "2017-02-07T07:46:49Z")

</div>

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