When restarting my machine Kibana pid file is removed automatically

I installed ELK version 6.3.2 on a centos 7 machine

The issue is when i restart this machine I have no more /var/run/kibana.pid file

Each time i restart the machine I have to do this commands :
touch /var/run/kibana.pid
chown kibana:kibana /var/run/kibana.pid
systemctl restart kibana

Have you some solution to this issue or I have to do a script that execute when my machine boot ?

Cloud this be because the "kibana" user is unable to create a pid file itself in the /var/run directory?

How did you install kibana?

I installed Kibana with rpm 6.x
The thing is I didn't got this issue on an other centos 7 machine with kibana 6.3.0

Is selinux enabled? What does the kibana log show upon trying to start the service exactly? The issue is a permissions one because it is able to delete the file on shutdown before restarting as it owns it

Yes SELinux is enabled
I have this error in my logs :

FATAL { Error: EACCES: permission denied, open '/var/run/kibana.pid'
  cause: 
   { Error: EACCES: permission denied, open '/var/run/kibana.pid'
     errno: -13,
     code: 'EACCES',
     syscall: 'open',
     path: '/var/run/kibana.pid' },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/var/run/kibana.pid' }

I think your right but how to change it

How do you start it? I have an init.d file and this file creates the pid file as owned by root. So something is done differently here :slight_smile:

Sorry for my late answer i search for this issue and i found topics related to this but had normally been fix : https://github.com/elastic/kibana/issues/7759 and https://github.com/elastic/kibana/issues/12055

My initial conf at /etc/systemd/system/kibana.service :

[Unit]
Description=Kibana

[Service]
Type=simple
User=kibana
Group=kibana
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/kibana
EnvironmentFile=-/etc/sysconfig/kibana
ExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
Restart=always
WorkingDirectory=/

[Install]
WantedBy=multi-user.target

I tried to add a kibana directory and add the two ExecStartPre lines but nothing to do it don't works

Lot of search for nothing I just removed the pid.file: /var/run/kibana.pid from the kibana conf /etc/kibana/kibana.yml and no more problem ^^ don't know why

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