Pid file not found on Ubuntu 16.04

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
% 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
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

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.

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?

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

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.

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