# Pid file not found on Ubuntu 16.04

**URL:** <https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921>\
**Category:** Beats\
**Created:** [November 3, 2016, 5:26pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921 "2016-11-03T17:26:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticMartin](https://avatars.discourse-cdn.com/v4/letter/e/779978/32.png) [@ElasticMartin](https://discuss.elastic.co/u/ElasticMartin)\
**Post date:** [November 3, 2016, 5:26pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/1 "2016-11-03T17:26:14Z")

</div>

Hi,  
I saw the other topic about the same issue but it's close. I got the same problem on Ubuntu.  
Same issue occur for Packetbeat and Filebeat.  
The init script looks ok but I the pid file is not created.  
The topbeat-god is suppose to create the pid file. How to figure out the issue with this binary.

Do I have to post also on github ?

Fresh machine traces:  
ubuntu@ip-10.0.0.1:~$ curl -L -O [https://download.elastic.co/beats/topbeat/topbeat\_1.3.1\_amd64.deb](https://download.elastic.co/beats/topbeat/topbeat_1.3.1_amd64.deb)  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
100 3613k 100 3613k 0 0 4170k 0 --:--:-- --:--:-- --:--:-- 4168k  
ubuntu@ip-10.0.0.1:~$ sudo dpkg -i topbeat\_1.3.1\_amd64.deb  
Selecting previously unselected package topbeat.  
(Reading database ... 53664 files and directories currently installed.)  
Preparing to unpack topbeat\_1.3.1\_amd64.deb ...  
Unpacking topbeat (1.3.1) ...  
Setting up topbeat (1.3.1) ...  
Processing triggers for systemd (229-4ubuntu11) ...  
Processing triggers for ureadahead (0.100.0-19) ...  
ubuntu@ip-10.0.0.1:~$ sudo service topbeat start  
ubuntu@ip-10.0.0.1:~$ sudo service topbeat status  
● topbeat.service - topbeat  
Loaded: loaded (/lib/systemd/system/topbeat.service; disabled; vendor preset: enabled)  
Active: active (running) since Thu 2016-11-03 13:27:36 UTC; 5min ago  
Docs: [https://www.elastic.co/guide/en/beats/topbeat/current/index.html](https://www.elastic.co/guide/en/beats/topbeat/current/index.html)  
Main PID: 21847 (topbeat)  
Tasks: 6  
Memory: 5.0M  
CPU: 1.261s  
CGroup: /system.slice/topbeat.service  
└─21847 /usr/bin/topbeat -c /etc/topbeat/topbeat.yml

Nov 03 13:27:36 ip-10.0.0.1 systemd[1]: Started topbeat.  
ubuntu@ip-10.0.0.1:~$ sudo ls -la /var/run/topbeat.pid  
ls: cannot access '/var/run/topbeat.pid': No such file or directory  
ubuntu@ip-10.0.0.1:~$ cat /proc/version  
Linux version 4.4.0-45-generic (buildd@lgw01-34) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) ) #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016

Thanks  
Martin

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [November 3, 2016, 5:45pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/2 "2016-11-03T17:45:02Z")

</div>

Your OS uses systemd which does not write a PID file. And `topbeat-god` is not used by systemd. The unit file for systemd is installed at `/lib/systemd/system/topbeat.service`.

---

<div class="post-metadata">

**Author:** ![ElasticMartin](https://avatars.discourse-cdn.com/v4/letter/e/779978/32.png) [@ElasticMartin](https://discuss.elastic.co/u/ElasticMartin)\
**Post date:** [November 3, 2016, 8:47pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/3 "2016-11-03T20:47:54Z")

</div>

Thanks andrewkroh for the quick answer.

Now that I know where to look, there is a PIDFile option for systemd but it is use like the start-stop-daemon only to check if the process is already running.

With topbeat help there is no '-p' option to create pid file.  
I would prefer to avoid to use another script with echo $!.  
Any plan to add this missing option?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [November 3, 2016, 9:21pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/4 "2016-11-03T21:21:09Z")

</div>

No, plans to add a `-p` option. We don't have a use for it. What are you using it for?

---

<div class="post-metadata">

**Author:** ![ElasticMartin](https://avatars.discourse-cdn.com/v4/letter/e/779978/32.png) [@ElasticMartin](https://discuss.elastic.co/u/ElasticMartin)\
**Post date:** [November 4, 2016, 12:03pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/5 "2016-11-04T12:03:27Z")

</div>

Wanted to use it with monit like I did with elasticsearch.pid but will do like suggested in other post with matching process name.  
...  
Then reading about systemd, since the topbeat service is set to restart always, I wonder if I really need monit at all.  
...  
Finally will only keep monit to check cluster health on elasticsearch only.

---

<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:** [November 24, 2016, 5:26pm UTC](https://discuss.elastic.co/t/pid-file-not-found-on-ubuntu-16-04/64921/6 "2016-11-24T17:26:34Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
