[Pkg-nagios-devel] Bug#679241: nagios-nrpe-server: please apply this patch for correct labelling of the /run directory

Russell Coker russell at coker.com.au
Wed Jun 27 11:41:55 UTC 2012


Package: nagios-nrpe-server
Version: 2.12-6
Severity: normal
Tags: patch

Please apply this patch to the init script to give the correct SE Linux
context to $PIDDIR.  This patch will have no affect if SE Linux is not enabled
but will make things work better for SE Linux users.

It would be nice if this could be uploaded in time for Wheezy.

--- nagios-nrpe-server.orig	2012-06-27 11:29:04.575445960 +0000
+++ nagios-nrpe-server	2012-06-27 11:29:31.871682394 +0000
@@ -44,6 +44,7 @@
 if [ ! -d "$PIDDIR" ]; then 
 	mkdir "$PIDDIR"
 	chown nagios "$PIDDIR"
+	[ -x /sbin/restorecon ] && /sbin/restorecon "$PIDDIR"
 fi
 
 set -e

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages nagios-nrpe-server depends on:
ii  adduser      3.113+nmu3
ii  libc6        2.13-33
ii  libssl1.0.0  1.0.1c-3
ii  libwrap0     7.6.q-23
ii  lsb-base     4.1+Debian7

Versions of packages nagios-nrpe-server recommends:
ii  nagios-plugins        1.4.16~pre1-1
ii  nagios-plugins-basic  1.4.16~pre1-1

nagios-nrpe-server suggests no packages.

-- Configuration Files:
/etc/init.d/nagios-nrpe-server changed:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nrpe
NAME=nagios-nrpe
DESC=nagios-nrpe
CONFIG=/etc/nagios/nrpe.cfg
PIDDIR=/var/run/nagios
test -x $DAEMON || exit 0
if ! [ -x "/lib/lsb/init-functions" ]; then
	. /lib/lsb/init-functions
else
	echo "E: /lib/lsb/init-functions not found, lsb-base (>= 3.0-6) 
needed"
	exit 1
fi
if [ -f /etc/default/nagios-nrpe-server ] ; then
	. /etc/default/nagios-nrpe-server
fi
if [ -f /etc/default/nagios-nrpe ]; then
	. /etc/default/nagios-nrpe
fi
if [ "$NICENESS" ]; then NICENESS="-n $NICENESS"; fi
if [ ! -d "$PIDDIR" ]; then 
	mkdir "$PIDDIR"
	chown nagios "$PIDDIR"
	[ -x /sbin/restorecon ] && /sbin/restorecon "$PIDDIR"
fi
set -e
case "$1" in
  start)
	if [ "$INETD" = 1 ]; then
		exit 1
	fi
	log_daemon_msg "Starting $DESC" "$NAME"
	start_daemon -p $PIDDIR/nrpe.pid $NICENESS $DAEMON  -c $CONFIG -d 
$DAEMON_OPTS
	log_end_msg $?
	;;
  stop)
	log_daemon_msg "Stopping $DESC" "$NAME"
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDDIR/nrpe.pid 
--retry 15
	log_end_msg $?
	;;
  reload|force-reload)
	log_daemon_msg "Reloading $DESC configuration files" "$NAME"
	start-stop-daemon --stop --signal HUP --quiet --pidfile 
$PIDDIR/nrpe.pid
	log_end_msg $?
	;;
  status)
    status_of_proc -p $PIDDIR/nrpe.pid "$DAEMON" "$NAME" && exit 0 || exit $?
    ;;
  restart)
	$0 stop
	sleep 1
	$0 start
	;;
  *)
	log_failure_msg "Usage: $N {start|stop|restart|reload|force-reload}" 
	exit 1
	;;
esac
exit 0


-- no debconf information


-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/





More information about the Pkg-nagios-devel mailing list