Date: Mon, 27 Oct 2008 14:44:27 +1030 (CST) From: Jarrod Sayers <jarrod@netleader.com.au> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/128409: [maintainer-update] net-mgmt/nrpe2: Update to 2.12 Message-ID: <200810270414.m9R4ERkg049812@manhattan.netleader.com.au> Resent-Message-ID: <200810270420.m9R4K2j2021603@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 128409 >Category: ports >Synopsis: [maintainer-update] net-mgmt/nrpe2: Update to 2.12 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Oct 27 04:20:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jarrod Sayers >Release: FreeBSD 7.0-RELEASE-p5 i386 >Organization: >Environment: System: FreeBSD manhattan.netleader.com.au 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #4: Fri Oct 24 14:12:01 CST 2008 root@manhattan.netleader.com.au:/usr/obj/usr/src/sys/MANHATTAN i386 >Description: Update to NRPE 2.12. Included in this PR is reload support requested by ports/126476 in addition to a change in the location of the PID file. I have however opted to move this file to NAGIOSDIR to reduce the number of directories created by all Nagios related ports. Modified Files: ports/net-mgmt/nrpe2/Makefile ports/net-mgmt/nrpe2/distinfo ports/net-mgmt/nrpe2/files/nrpe2.in ports/net-mgmt/nrpe2/files/pkg-install.in ports/net-mgmt/nrpe2/files/pkg-message.in Removed Files: ports/net-mgmt/nrpe2/files/patch-src-nrpe.c Added Files: ports/net-mgmt/nrpe2/pkg-plist Due to the move in PID file, an entry in ports/UPDATING will be needed: --<>-- 20081027: AFFECTS: users of net-mgmt/nrpe2 AUTHOR: Jarrod Sayers <jarrod@netleader.com.au> The expected location of the nrpe2 PID file has changed from /var/run/nrpe2.pid to /var/spool/nagios/nrpe2.pid. Refer to nrpe.cfg-sample for an updated example of the pid_file option. --<>-- >How-To-Repeat: >Fix: Downloadable diff from: http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nrpe2-2.12.diff --- net-mgmt-nrpe2-2.12.diff begins here --- diff -ruN ports/net-mgmt/nrpe2.orig/Makefile ports/net-mgmt/nrpe2/Makefile --- ports/net-mgmt/nrpe2.orig/Makefile 2008-06-06 23:23:04.000000000 +0930 +++ ports/net-mgmt/nrpe2/Makefile 2008-10-27 14:14:37.000000000 +1030 @@ -5,13 +5,13 @@ # $FreeBSD: ports/net-mgmt/nrpe2/Makefile,v 1.24 2008/06/06 13:53:04 edwin Exp $ # -PORTNAME= nrpe2 -PORTVERSION= 2.11 -PORTREVISION= 1 +PORTNAME= nrpe +DISTVERSION= 2.12 CATEGORIES= net-mgmt -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITES= SF MASTER_SITE_SUBDIR= nagios -DISTNAME= nrpe-${PORTVERSION} + +LATEST_LINK= nrpe2 MAINTAINER= jarrod@netleader.com.au COMMENT= Nagios Remote Plugin Executor @@ -21,8 +21,10 @@ USE_PERL5_BUILD= yes USE_RC_SUBR= nrpe2 -OPTIONS= SSL "SSL support" off \ - ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off +CONFLICTS= nrpe-1.* + +OPTIONS= SSL "Enable SSL support (disables plain-text server)" off \ + ARGS "Enable command argument processing **Security Risk**" off GNU_CONFIGURE= yes @@ -33,15 +35,14 @@ NAGIOSUID= 181 NAGIOSGID= ${NAGIOSUID} -CONFIGURE_ARGS+= --bindir=${PREFIX}/sbin \ +CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \ --libexecdir=${PREFIX}/libexec/nagios \ --sysconfdir=${PREFIX}/etc \ + --localstatedir=${NAGIOSDIR} \ --with-nrpe-user=${NAGIOSUSER} \ --with-nrpe-group=${NAGIOSGROUP} -PLIST_FILES= sbin/nrpe2 etc/nrpe.cfg-sample libexec/nagios/check_nrpe2 - -SUB_VARS= NAGIOSDIR=${NAGIOSDIR} \ +PLIST_SUB= NAGIOSDIR=${NAGIOSDIR} \ NAGIOSUSER=${NAGIOSUSER} \ NAGIOSGROUP=${NAGIOSGROUP} \ NAGIOSUID=${NAGIOSUID} \ @@ -51,8 +52,8 @@ pkg-deinstall \ pkg-message -SUB_LIST+= ${SUB_VARS} -PLIST_SUB+= ${SUB_VARS} +SUB_LIST= PREFIX=${PREFIX} \ + ${PLIST_SUB} .include <bsd.port.pre.mk> @@ -65,10 +66,12 @@ .if defined(WITH_ARGS) CONFIGURE_ARGS+= --enable-command-args +.else +CONFIGURE_ARGS+= --disable-command-args .endif post-patch: - @${REINPLACE_CMD} -e 's#nrpe.pid#nrpe2.pid#g' \ + @${REINPLACE_CMD} -e 's#/var/run/nrpe.pid#@localstatedir@/nrpe2.pid#g' \ -e 's#/usr/lib/nagios/plugins/#${LOCALBASE}/libexec/nagios/#g' \ -e 's#/usr/bin/sudo#${LOCALBASE}/bin/sudo#g' \ ${WRKSRC}/sample-config/nrpe.cfg.in @@ -82,6 +85,7 @@ ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample post-install: + @${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff -ruN ports/net-mgmt/nrpe2.orig/distinfo ports/net-mgmt/nrpe2/distinfo --- ports/net-mgmt/nrpe2.orig/distinfo 2008-02-21 05:48:36.000000000 +1030 +++ ports/net-mgmt/nrpe2/distinfo 2008-10-27 11:44:32.000000000 +1030 @@ -1,3 +1,3 @@ -MD5 (nrpe-2.11.tar.gz) = dcf3b7c5b7c94c0ba6cbb4999c1161f0 -SHA256 (nrpe-2.11.tar.gz) = 4cedfc2588ba65ebfe4e3310c9fbda08c6f0912cfcc2c1ac96636b6f5c839e1d -SIZE (nrpe-2.11.tar.gz) = 405643 +MD5 (nrpe-2.12.tar.gz) = b2d75e2962f1e3151ef58794d60c9e97 +SHA256 (nrpe-2.12.tar.gz) = 7e8d093abef7d7ffc7219ad334823bdb612121df40de2dbaec9c6d0adeb04cfc +SIZE (nrpe-2.12.tar.gz) = 405725 diff -ruN ports/net-mgmt/nrpe2.orig/files/nrpe2.in ports/net-mgmt/nrpe2/files/nrpe2.in --- ports/net-mgmt/nrpe2.orig/files/nrpe2.in 2007-07-24 22:27:40.000000000 +0930 +++ ports/net-mgmt/nrpe2/files/nrpe2.in 2008-10-27 12:43:03.000000000 +1030 @@ -9,25 +9,31 @@ # # Add the following lines to /etc/rc.conf to enable nrpe2: -# -#nrpe2_enable="YES" -# +# nrpe2_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable nrpe2. +# nrpe2_flags (str): Set to "" by default. +# nrpe2_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default. # . %%RC_SUBR%% -name=nrpe2 +name="nrpe2" rcvar=`set_rcvar` command="%%PREFIX%%/sbin/nrpe2" -required_files=%%PREFIX%%/etc/nrpe.cfg -command_args="-c ${required_files} -d" -pidfile=/var/run/${name}.pid +command_args="-d" +extra_commands="reload" +pidfile="%%NAGIOSDIR%%/nrpe2.pid" + +sig_reload=HUP + +[ -z "${nrpe2_enable}" ] && nrpe2_enable="NO" +[ -z "${nrpe2_flags}" ] && nrpe2_flags="" +[ -z "${nrpe2_configfile}" ] && nrpe2_configfile="%%PREFIX%%/etc/nrpe.cfg" -# set defaults +load_rc_config "${name}" -nrpe2_enable=${nrpe2_enable:-"NO"} -nrpe2_flags=${nrpe2_flags:-""} +required_files="${nrpe2_configfile}" +command_args="${command_args} -c ${nrpe2_configfile}" -load_rc_config ${name} run_rc_command "$1" diff -ruN ports/net-mgmt/nrpe2.orig/files/patch-src-nrpe.c ports/net-mgmt/nrpe2/files/patch-src-nrpe.c --- ports/net-mgmt/nrpe2.orig/files/patch-src-nrpe.c 2008-02-21 05:48:37.000000000 +1030 +++ ports/net-mgmt/nrpe2/files/patch-src-nrpe.c 1970-01-01 09:30:00.000000000 +0930 @@ -1,15 +0,0 @@ ---- src/nrpe.c.orig 2007-12-27 05:55:05.000000000 +1030 -+++ src/nrpe.c 2008-02-20 19:19:03.000000000 +1030 -@@ -1458,8 +1458,10 @@ - }while(bytes_read==-1 && errno==EINTR); - } - -- if(bytes_read==-1 && output!=NULL) -- strcpy(output,""); -+ if(bytes_read==-1) -+ *output='\0'; -+ else -+ output[bytes_read]='\0'; - - /* if there was a critical return code and no output AND the command time exceeded the timeout thresholds, assume a timeout */ - if(result==STATE_CRITICAL && bytes_read==-1 && (end_time-start_time)>=timeout){ diff -ruN ports/net-mgmt/nrpe2.orig/files/pkg-install.in ports/net-mgmt/nrpe2/files/pkg-install.in --- ports/net-mgmt/nrpe2.orig/files/pkg-install.in 2007-07-24 22:27:40.000000000 +0930 +++ ports/net-mgmt/nrpe2/files/pkg-install.in 2008-10-27 14:16:05.000000000 +1030 @@ -39,7 +39,7 @@ ;; esac echo "Please answer yes or no." - done + done } if [ "$2" = "PRE-INSTALL" ]; then @@ -71,4 +71,10 @@ exit 1 fi fi +elif [ "$2" = "POST-INSTALL" ]; then + if [ ! -e "${NAGIOSDIR}" ]; then + /bin/mkdir -p "${NAGIOSDIR}" + /bin/chmod 775 "${NAGIOSDIR}" + /usr/sbin/chown "${NAGIOSUSER}":"${NAGIOSGROUP}" "${NAGIOSDIR}" + fi fi diff -ruN ports/net-mgmt/nrpe2.orig/files/pkg-message.in ports/net-mgmt/nrpe2/files/pkg-message.in --- ports/net-mgmt/nrpe2.orig/files/pkg-message.in 2007-04-08 00:04:14.000000000 +0930 +++ ports/net-mgmt/nrpe2/files/pkg-message.in 2008-10-27 12:18:56.000000000 +1030 @@ -1,5 +1,10 @@ -************************************************************************* -Available variables you add/set to /etc/rc.conf: -- nrpe2_enable (bool): Set to "NO" by default -- nrpe2_flags (string): Set to "" by default -************************************************************************* +********************************************************************** + + Enable NRPE in /etc/rc.conf with the following line: + + nrpe2_enable="YES" + + A sample configuration is available in %%PREFIX%%/etc/nrpe.cfg-sample. + Copy to nrpe.cfg where required and edit to suit your needs. + +********************************************************************** diff -ruN ports/net-mgmt/nrpe2.orig/pkg-plist ports/net-mgmt/nrpe2/pkg-plist --- ports/net-mgmt/nrpe2.orig/pkg-plist 1970-01-01 09:30:00.000000000 +0930 +++ ports/net-mgmt/nrpe2/pkg-plist 2008-10-27 14:03:54.000000000 +1030 @@ -0,0 +1,4 @@ +etc/nrpe.cfg-sample +libexec/nagios/check_nrpe2 +sbin/nrpe2 +@unexec rmdir %%NAGIOSDIR%% 2>/dev/null || true --- net-mgmt-nrpe2-2.12.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810270414.m9R4ERkg049812>