Bug 34063 - nagios-nrpe-server doesn't create a pid file
nagios-nrpe-server doesn't create a pid file
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Nagios
UCS 3.2
amd64 Linux
: P5 normal (vote)
: UCS 3.2-1-errata
Assigned To: Felix Botner
Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-06 09:14 CET by Ulf Friedel
Modified: 2014-04-30 08:49 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulf Friedel 2014-02-06 09:14:38 CET
UCS 3.2 Errata 45
nagios-nrpe-server version 2.12-4.12.201104270034


Due to missing permissions, the nagios user cannot create it's pid file in /var/run.

# cat /var/log/syslog | grep nrpe.pid
Jan 24 13:14:10 master nrpe[23500]: Cannot write to pidfile '/var/run/nrpe.pid' - check your privileges.


According to the change log of nagios-nrpe-server the handling of pid files in version 2.12-4 was changed:

* Fix pidfile handling (Closes: #411046)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411046


See the configuration file /etc/nagios/nrpe.cfg.debian for details:

# PID FILE
# The name of the file in which the NRPE daemon should write it's process ID
# number.  The file is only written if the NRPE daemon is started by the root
# user and is running in standalone mode.

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


This was not included in the current Univention-Template as expexted:

/etc/univention/templates/files/etc/nagios/nrpe.cfg

# PID FILE
# The name of the file in which the NRPE daemon should write it's process ID
# number.  The file is only written if the NRPE daemon is started by the root
# user and is running in standalone mode.

pid_file=/var/run/nrpe.pid


This is important, since the nagios-nrpe-server (version 2.12-5) start-stop-daemon uses the pid file.

* [e776f7b] Use pidfile for start-stop-daemon and fix pidfile deletion (Closes: #548157, #639523)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639523


I feel /etc/univention/templates/files/etc/nagios/nrpe.cfg needs to be changed accordingly.
Comment 1 Felix Botner univentionstaff 2014-03-17 14:45:42 CET
In univention-nagios-client:

 * Changed pid_file to /var/run/nagios/nrpe.pid in
   /etc/univention/templates/files/etc/nagios/nrpe.cfg

 * Create and "chown nagios" PIDDIR=/var/run/nagios in
   /etc/univention/templates/files/etc/init.d/nagios-nrpe-server:

YAML: 2014-03-17-univention-nagios.yaml
Comment 2 Philipp Hahn univentionstaff 2014-04-03 13:28:41 CEST
OK: r48584,r48571
OK: grep nrpe.pid /var/log/syslog
OK: aptitude install '?source-package(univention-nagios)?installed'
OK: ps $(</var/run/nagios/nrpe.pid)
OK: ~/bin/announce_errata -V 2014-03-17-univention-nagios.yaml
FIXED: r48586,r49020 2014-03-17-univention-nagios.yaml
Comment 3 Moritz Muehlenhoff univentionstaff 2014-04-30 08:49:34 CEST
http://errata.univention.de/ucs/3.2/101.html