For a daemon, the init.d script use a PID to track the process. Usually PID are stored in /run or /var/run.
In case of daemon running as non-root, the PID dir must be writable by the daemon user. The solution was to create a folder /var/run/daemon-name/ owned the the daemon user. The folder was created during installation (e.g. in the package .rpm or .deb).
But in most current Linux distribution (at least Ubuntu, CentOS and Fedora), /var/run and /run are tmpfs which is not persisted across reboot, so the /var/run/daemon-name/ need to be re-created.
This PR add the creation of the PID dir and changing ownership to user.
For a daemon, the init.d script use a PID to track the process. Usually PID are stored in /run or /var/run.
In case of daemon running as non-root, the PID dir must be writable by the daemon user. The solution was to create a folder /var/run/daemon-name/ owned the the daemon user. The folder was created during installation (e.g. in the package .rpm or .deb).
But in most current Linux distribution (at least Ubuntu, CentOS and Fedora), /var/run and /run are tmpfs which is not persisted across reboot, so the /var/run/daemon-name/ need to be re-created.
This PR add the creation of the PID dir and changing ownership to user.
It will fix jmxtrans issue https://github.com/jmxtrans/jmxtrans/issues/578