I have installed Kibana 6 in Centos 7.4 and I have configured pid file location to /var/run/mypidfile.pid. I want to write in this location because when server is rebooted, I need that Kibana starts automatically.
I have tried changing pid file location to under kibana owned directory. It only works when I start and stop manually the process, but not when the server is rebooted. Whether /var/run/mypidfile.pid location is setted previusly with right Kibana permissions, It is not valid after server has been rebooted.
Journalctl shows this.
may 02 03:42:22 SERVER.localdomain kibana[4509]: at Error (native)
may 02 03:42:22 SERVER.localdomain kibana[4509]: { Error: EACCES: permission denied, open '/var/run/mypidfile.pid'
may 02 03:42:22 SERVER.localdomain kibana[4509]: cause:
may 02 03:42:22 SERVER.localdomain kibana[4509]: at Error (native)
may 02 03:42:22 SERVER.localdomain kibana[4509]: FATAL { Error: EACCES: permission denied, open '/var/run/mypidfile.pid'
may 02 03:42:22 SERVER.localdomain kibana[4509]: {"type":"error","@timestamp":"2018-05-02T08:42:22Z","tags":["fatal"]," may 02 03:42:20 SERVER.localdomain systemd[1]: Starting Kibana...
SELinux:
Enforcing
I have reviewed audit.log file. There were no messages.
/etc/kibana.yml
pid.file: /var/run/mypidfile.pid
I have tried to resolve it by setting some unit-d file variables.
ExecStartPre=touch /var/run/mypidfile.pid
ExecStartPre=chown kibana /var/run/mypidfile.pid
It did not work. So, I tried with another variable, dropping after-mentioned variables.
PIDFile=/var/run/mypidfile.pid
Are there another manner to do this?