nrpe server starts too early and fails to bind on IP

Bug #838437 reported by John Plaxco
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
nagios-nrpe (Debian)
Fix Released
Unknown
nagios-nrpe (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When the bind address specified in nrpe.cfg is not available and the binding fails at startup, the startup/init script says that the service was successfully started but really it was not. The server does not stay resident and retry the bind. Therefore, I believe the proper behavior here should be to report a failure.

Steps to reproduce:

apt-get install nagios-nrpe-server
nano /etc/nagios/nrpe.cfg
[change the bind address to one the system doesn't currently have, thus the binding will fail]
service nagios-nrpe-server restart

Expected results:
init script reports [failed] like other services when they fail to start.

Actual results:
init script reports [OK], but service is not running. /var/log/syslog contains the following:

Aug 31 18:24:35 ito nrpe[19683]: Starting up daemon
Aug 31 18:24:35 ito nrpe[19683]: Network server bind failure (99: Cannot assign requested address)

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: nagios-nrpe-server 2.12-4ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.42-server 2.6.38.2
Uname: Linux 2.6.38-8-server x86_64
Architecture: amd64
Date: Wed Aug 31 18:29:46 2011
InstallationMedia: Ubuntu-Server 11.04 "Natty Narwhal" - Release amd64 (20110426)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nagios-nrpe
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
John Plaxco (c-launchpad-ignisobscurae-com) wrote :
Revision history for this message
Simon Déziel (sdeziel) wrote :

I confirmed this on a Lucid container. Setting "server_address=1.2.3.4" and starting/restarting nagios-nrpe-server reports no error but the log says otherwise :

# /etc/init.d/nagios-nrpe-server start
Starting nagios-nrpe: nagios-nrpe.
# echo $?
0
# tail -n2 /var/log/daemon.log
Oct 25 10:54:36 server1030 nrpe[20150]: Starting up daemon
Oct 25 10:54:36 server1030 nrpe[20150]: Network server bind failure (99: Cannot assign requested address)

# lsb_release -rd
Description: Ubuntu 10.04.3 LTS
Release: 10.04

# apt-cache policy nagios-nrpe-server
nagios-nrpe-server:
  Installed: 2.12-4ubuntu1.10.04.1
  Candidate: 2.12-4ubuntu1.10.04.1
  Version table:
 *** 2.12-4ubuntu1.10.04.1 0
        500 http://archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        100 /var/lib/dpkg/status
     2.12-4ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages

Changed in nagios-nrpe (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Déziel (sdeziel) wrote :

This bug also affects Lucid and Precise and fix/workaround would be greatly appreciated. Maybe converting the initscript to an upstart job would avoid this race ?

summary: - startup script reports success, but nrpe server fails to start
+ nrpe server starts too early and fails to bind on IP
Changed in nagios-nrpe (Debian):
status: Unknown → New
Revision history for this message
Andrey Konstantinov (andreyinvolute) wrote :

Surprised to see the bug is so old. It only affects people who use server_address directive. We have a Nagios server with ~30 clients connected via OpenVPN and only recently started adding the server_address directive to NRPE configs on clients. All of them will fail to start NRPE on boot since naturally, OpenVPN address isn't up until a while after networking has come up. This happens on both Debian 7 and Ubuntu 12.04. NRPE startup should somehow be moved after networking.

Changed in nagios-nrpe (Debian):
status: New → Fix Released
Revision history for this message
Bas Couwenberg (sebastic) wrote :

nagios-nrpe (3.0.1-2) includes a systemd service file which should resolve this issue.

Changed in nagios-nrpe (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.