Bug 1639819 - nrpe service file fails after updating to 3.2.1
Summary: nrpe service file fails after updating to 3.2.1
Keywords:
Status: CLOSED DUPLICATE of bug 1637727
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nrpe
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Stephen John Smoogen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-16 16:41 UTC by jordan.english
Modified: 2018-10-16 17:46 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 16:47:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description jordan.english 2018-10-16 16:41:28 UTC
Description of problem:
The service file changes from 3.2.0 to 3.2.1 and causes nrpe daemon to hang when attempting to start.

Version-Release number of selected component (if applicable):
3.2.1

How reproducible:
Always

Steps to Reproduce:
1. Update nrpe from EPEL repo from 3.2.0 to 3.2.1
2. Restart nrpe service
3. Fails waiting for PID file

Actual results:
(PRO-BOY|jenglish@<hostname> ~)$ sudo systemctl restart nrpe
Job for nrpe.service failed because a configured resource limit was exceeded. See "systemctl status nrpe.service" and "journalctl -xe" for details.
(PRO-BOY|jenglish@<hostname> ~)$ journalctl -u nrpe -S 11:00
-- Logs begin at Sat 2018-10-13 04:00:00 EDT, end at Tue 2018-10-16 11:08:33 EDT. --
Oct 16 11:08:33 <hostname> systemd[1]: Starting Nagios Remote Program Executor...
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_users]=/usr/lib64/nagios/plug
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_load]=/usr/lib64/nagios/plugi
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_disk]=/usr/lib64/nagios/plugi
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_temp]=/usr/lib64/nagios/plugi
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_procs]=/usr/lib64/nagios/plug
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_lock_age]=/usr/lib64/nagios/p
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_ntp_time]=/usr/lib64/nagios/p
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_file_age]=sudo /usr/lib64/nag
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_init]=/usr/lib64/nagios/plugi
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_swap]=/usr/lib64/nagios/plugi
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_generic]=/usr/lib64/nagios/pl
Oct 16 11:08:33 <hostname> nrpe[123230]: Added command[check_tcp]=/usr/lib64/nagios/plugin
Oct 16 11:08:33 <hostname> systemd[1]: PID file /var/run/nrpe/nrpe.pid not readable (yet?)
Oct 16 11:08:33 <hostname> systemd[1]: nrpe.service never wrote its PID file. Failing.
Oct 16 11:08:33 <hostname> systemd[1]: Failed to start Nagios Remote Program Executor.
Oct 16 11:08:33 <hostname> systemd[1]: Unit nrpe.service entered failed state.
Oct 16 11:08:33 <hostname> systemd[1]: nrpe.service failed.

Expected results:
(PRO-BOY|jenglish@<hostname> ~)$ sudo journalctl -u nrpe -S 12:39
-- Logs begin at Tue 2018-10-09 19:06:01 EDT, end at Tue 2018-10-16 12:39:53 EDT. --
Oct 16 12:39:05 <hostname> systemd[1]: Stopping Nagios Remote Program Executor...
Oct 16 12:39:05 <hostname> systemd[1]: Starting Nagios Remote Program Executor...
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_users]=/usr/lib64/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_load]=/usr/lib64/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_disk]=/usr/lib64/nagios/plugins/check_disk -E -w $ARG1$ -c $ARG2$ -p $ARG3$
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_temp]=/usr/lib64/nagios/plugins/check_temp -w $ARG1$ -c $ARG2$
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_procs]=/usr/lib64/nagios/plugins/check_procs -C $ARG1$ -c $ARG2$
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_lock_age]=/usr/lib64/nagios/plugins/check_file_age_wrapper.sh
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_ntp_time]=/usr/lib64/nagios/plugins/check_ntp_time -H 192.168.5.2 -w 0.5 -c 1
Oct 16 12:39:05 <hostname> nrpe[2219]: Added command[check_file_age]=sudo /usr/lib64/nagios/plugins/check_file_age -f $ARG1$ -W $ARG2$ -C $ARG3$ -w $ARG4$ -c $ARG5$
Oct 16 12:39:05 <hostname> systemd[1]: Started Nagios Remote Program Executor.
Oct 16 12:39:05 <hostname> nrpe[2220]: Starting up daemon
Oct 16 12:39:05 <hostname> nrpe[2220]: SETUP_WAIT_CONN FOR: IPv4 address: 0.0.0.0 ((null))
Oct 16 12:39:05 <hostname> nrpe[2220]: Server listening on 0.0.0.0 port 5666.
Oct 16 12:39:05 <hostname> nrpe[2220]: SETUP_WAIT_CONN FOR: IPv4 address: :: ((null))
Oct 16 12:39:05 <hostname> nrpe[2220]: Server listening on :: port 5666.
Oct 16 12:39:05 <hostname> nrpe[2220]: Warning: Daemon is configured to accept command arguments from clients!
Oct 16 12:39:05 <hostname> nrpe[2220]: Listening for connections on port 5666
Oct 16 12:39:05 <hostname> nrpe[2220]: Allowing connections from: 127.0.0.1,10.0.130.70,172.27.17.133,172.24.17.133

Additional info:

Comment 1 Stephen John Smoogen 2018-10-16 16:47:28 UTC
This will be covered in 1637727. The problem is that the nrpe.cfg has the correct settings but is not going to be seen on any system with an updated config. I have made and put -8 today which should show up in epel-testing. Please test this and let me know.

Comment 2 Stephen John Smoogen 2018-10-16 16:47:54 UTC

*** This bug has been marked as a duplicate of bug 1637727 ***

Comment 3 jordan.english 2018-10-16 17:20:34 UTC
3.2.1-8 appears to be working. We updated in this order:
3.2.0 -> 3.2.1-6 -> 3.2.1.-8

Is the only change to comment out the PID file option?

(ITG-FM|jenglish@ftm-roiditgdb01 ~)$ sudo systemctl cat nrpe
# /usr/lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
Conflicts=nrpe.socket
Requires=network-online.target
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=getty xdm.service

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=nrpe
Group=nrpe
EnvironmentFile=/etc/sysconfig/nrpe
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f $NRPE_SSL_OPT
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/bin/rm -f /var/run/nrpe/nrpe.pid
#PIDFile=/var/run/nrpe/nrpe.pid

Comment 4 Stephen John Smoogen 2018-10-16 17:33:15 UTC
There are several changes. One we move from a forking to a simple mode. Two we turn off the daemon part of the execstart. Third we remove the PIDFile. 

PIDFile will remain in Fedora channels and any future RHEL as the config in that contains pid_file=/var/run/nrpe/nrpe.pid line. 

diff --git a/nrpe.service.epel b/nrpe.service.epel
index 44922d0..d3bf549 100644
--- a/nrpe.service.epel
+++ b/nrpe.service.epel
@@ -10,11 +10,11 @@ Before=getty xdm.service
 WantedBy=multi-user.target
 
 [Service]
-Type=forking
+Type=simple
 User=nrpe
 Group=nrpe
 EnvironmentFile=/etc/sysconfig/nrpe
-ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT
+ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f $NRPE_SSL_OPT
 ExecReload=/bin/kill -HUP $MAINPID
 ExecStopPost=/bin/rm -f /var/run/nrpe/nrpe.pid
-PIDFile=/var/run/nrpe/nrpe.pid
+#PIDFile=/var/run/nrpe/nrpe.pid
diff --git a/nrpe.spec b/nrpe.spec
index 400b518..c7e6ada 100644
--- a/nrpe.spec
+++ b/nrpe.spec

Comment 5 jordan.english 2018-10-16 17:35:24 UTC
Thank you for the update and information. When will 3.2.1-8 be ready for the standard EPEL repo?

Comment 6 Stephen John Smoogen 2018-10-16 17:46:08 UTC
It will go into EPEL-testing during the next successful compose. After that it will be there until it gets 2 +1 tests. I would like to make sure it gets tested as it was 'autopromoted' last time without adequate testing.


Note You need to log in before you can comment on or make changes to this bug.