Typically one can create the appropriate folders in /run (aka symbolic link /var/run) using a "d" statement in the relative /usr/lib/tmpfiles.d/nrpe.conf file.
- Code: Select all
d /var/run/nrpe 0775 nrpe nrpe -
f /var/run/nrpe/nrpe.pid 755 nrpe nrpe
But,
error results. I can create the folder and launch nrpe after the fact with root privileges, and it works fine until the next boot. I have tried creating the directory using an ExecStartPre= statement in the enabled nrpe.service file to no avail.SELinux is preventing (mkdir) from mounton access on the directory /run/nrpe
- Code: Select all
[Service]
Type=simple
Restart=on-abort
ExecStartPre=-/usr/bin/mkdir /var/run/nrpe
RuntimeDirectory=nrpe
PIDFile=/var/run/nrpe/nrpe.pid
RuntimeDirectoryMode=0755
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/bin/rm -f /var/run/nrpe/nrpe.pid
TimeoutStopSec=60
User=nrpe
Group=nrpe
PrivateTmp=true
OOMScoreAdjust=-500
In each scenario SELinux is preventing the mkdir. I even added appropriate filecontext type to the folder after creating it manually. This did not help with the reboot.
Any suggestions would be appreciated. Thanks in advance.