Bug 1428769

Summary: NRPE uses nagios log dir for pid file
Product: [Fedora] Fedora EPEL Reporter: Jan ONDREJ <ondrejj>
Component: nrpeAssignee: Stephen John Smoogen <smooge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: athmanem, b.heden, jose.p.oliveira.oss, kmf, mhayden, ondrejj, redhat, smooge, smooge, s, swilkerson
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nrpe-3.1.1-1.fc24 nrpe-3.1.1-1.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-04 00:20:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan ONDREJ 2017-03-03 10:55:23 UTC
Description of problem:
In current epel-testing nrpe, this is set:
PID_FILE=/var/log/nagios/nrpe.pid
This is hardcoded in init script, so unable to change in config file, otherwise nrpe will not restart properly.

Version-Release number of selected component (if applicable):
nrpe-3.0.1-1.el6.x86_64 (currently epel-testing)

How reproducible:
always

Steps to Reproduce:
1. /etc/init.d/nrpe restart
2. ls -la /var/log/nagios

Actual results:
cannot access non-existent directory

Expected results:


Additional info:
There is no /var/log/nagios on servers, which use only NRPE and there is no significant need to use NRPE on nagios servers.

After upgrade from version 2 to 3, restart does not restart old nrpe due to problems to find it's PID file. Please leave old pid file for NRPE 3, as was used in NRPE 2.

Also consider using /etc/sysconfig/nrpe file for configuration parameters, even if this is mostly an obsolete file for CentOS 6 only (newer systems are using systemd).

Comment 1 Stephen John Smoogen 2017-03-03 14:14:31 UTC
Urgh. OK I am not sure how this got put in. I will look at the scripts involved and work out your solution as that is what I would do. [It will need to go in /var/run/nrpe I believe for default]

Comment 2 Jan ONDREJ 2017-03-03 14:16:42 UTC
This is from nrpe2 configuration:

pid_file=/var/run/nrpe/nrpe.pid

Try to leave same file to avoid problems when upgrading package.
Do not forget to create /var/run/nrpe directory. I think /var/run on CentOS 6 is normal filesystem (not in RAM).

Comment 3 Fedora Update System 2017-03-03 23:30:29 UTC
nrpe-3.0.1-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c4f49632d3

Comment 4 Fedora Update System 2017-03-04 00:08:25 UTC
nrpe-3.0.1-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a89da38bf3

Comment 5 Jan ONDREJ 2017-03-04 05:51:43 UTC
Looks better. There is an /etc/sysconfig/nrpe, but looks like it's never loaded from init script on CentOS 6. Consider adding this to init script:

[ -e /etc/sysconfig/nrpe ] && . /etc/sysconfig/nrpe

I think this sysconfig file is not necessary for CentOS 7 or Fedoras, because it's not used in systemd service file and it's not so useful as for sysvinit script.

Comment 6 Fedora Update System 2017-03-05 04:20:42 UTC
nrpe-3.0.1-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c4f49632d3

Comment 7 Fedora Update System 2017-03-05 04:23:31 UTC
nrpe-3.0.1-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a89da38bf3

Comment 8 Stephen John Smoogen 2017-03-22 18:38:59 UTC
OK I have put the fixes back into the RPM. Hopefully -5 will work for you after I get it built.

Comment 9 Fedora Update System 2017-03-23 21:50:43 UTC
nrpe-3.0.1-6.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8f92515d27

Comment 10 Fedora Update System 2017-03-23 22:08:42 UTC
nrpe-3.0.1-6.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d12527a635

Comment 11 Fedora Update System 2017-03-24 19:53:15 UTC
nrpe-3.0.1-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8f92515d27

Comment 12 Fedora Update System 2017-03-24 20:24:39 UTC
nrpe-3.0.1-6.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d12527a635

Comment 13 Christian Kujau 2017-05-11 06:16:05 UTC
# rpm -q nrpe
nrpe-3.0.1-6.fc25.x86_64

# fgrep -h .pid /etc/nagios/nrpe.cfg /etc/systemd/system/multi-user.target.wants/nrpe.service 
pid_file=/var/run/nrpe/nrpe.pid
PIDFile=/var/run/nrpe/nrpe.pid
ExecStopPost=/bin/rm -f /var/run/nrpe/nrpe.pid

# ps -fp `cat /var/run/nrpe/nrpe.pid`
UID        PID  PPID  C STIME TTY          TIME CMD
nrpe      5761     1  0 23:06 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f -n

Comment 14 Fedora Update System 2017-05-14 15:51:25 UTC
nrpe-3.1.0-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-665b1abde6

Comment 15 Fedora Update System 2017-05-15 06:35:38 UTC
nrpe-3.1.0-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-665b1abde6

Comment 16 Christian Kujau 2017-05-15 20:40:22 UTC
# rpm -q nrpe; fgrep -h .pid /etc/nagios/nrpe.cfg /etc/systemd/system/multi-user.target.wants/nrpe.service 
nrpe-3.1.0-3.fc25.x86_64
pid_file=/var/run/nrpe.pid

With nrpe-3.1.0-3.fc25, nrpe.cfg specifies pid_file again to /var/run/nrpe.pid (which is not preferred, see bug 1236081) and is also missing PIDFile from nrpe.service, which also causes bug 1412214 to re-appear.

Comment 17 Fedora Update System 2017-06-15 00:03:28 UTC
nrpe-3.1.1-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-eb24165ee1

Comment 18 Fedora Update System 2017-06-15 00:37:28 UTC
nrpe-3.1.1-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-be117b53a8

Comment 19 Fedora Update System 2017-06-15 10:57:59 UTC
nrpe-3.1.1-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-be117b53a8

Comment 20 Fedora Update System 2017-06-15 10:59:54 UTC
nrpe-3.1.1-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-eb24165ee1

Comment 21 Fedora Update System 2017-07-04 00:20:11 UTC
nrpe-3.1.1-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2017-07-04 01:51:22 UTC
nrpe-3.1.1-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.