ports/129386: [patch] net-mgmt/nrpe2: add nrpe2_pidfile knob

Eygene Ryabinkin rea-fbsd at codelabs.ru
Wed Dec 3 09:30:02 UTC 2008


>Number:         129386
>Category:       ports
>Synopsis:       [patch] net-mgmt/nrpe2: add nrpe2_pidfile knob
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 03 09:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.1-PRERELEASE i386
>Organization:
Code Labs
>Environment:

System: FreeBSD 7.1-PRERELEASE i386

>Description:

rc.d script for nrpe2 uses hardcoded value of pidfile.  It is not always
good, because some people might want to place pid file in some
non-default location.  One can hack rc.d script, but he will need to do
it everytime the port upgrades.  Not cool...

>How-To-Repeat:

Set PID file location in the nrpe.cfg to the non-standard value and
try to restart the daemon via rc.d script.  It will refuse to stop
the daemon, because of missing PID file.

>Fix:

The following patch takes care about the situation.
--- add-knob-nrpe2_pidfile.diff begins here ---
>From 2b020ab731eedbeac539103196fd5866007aa736 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Date: Wed, 3 Dec 2008 11:23:11 +0300

Modify rc.d script to allow administrator to change PID file location
without editing rc.d script.  New knob nrpe2_pidfile is provided for
this and it defaults to the old value of the PID file.

Signed-off-by: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
---
 net-mgmt/nrpe2/Makefile       |    1 +
 net-mgmt/nrpe2/files/nrpe2.in |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net-mgmt/nrpe2/Makefile b/net-mgmt/nrpe2/Makefile
index dfbc564..315786d 100644
--- a/net-mgmt/nrpe2/Makefile
+++ b/net-mgmt/nrpe2/Makefile
@@ -7,6 +7,7 @@
 
 PORTNAME=	nrpe
 DISTVERSION=	2.12
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	SF
 MASTER_SITE_SUBDIR=	nagios
diff --git a/net-mgmt/nrpe2/files/nrpe2.in b/net-mgmt/nrpe2/files/nrpe2.in
index e80e519..0213beb 100644
--- a/net-mgmt/nrpe2/files/nrpe2.in
+++ b/net-mgmt/nrpe2/files/nrpe2.in
@@ -13,6 +13,8 @@
 #                         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.
+# nrpe2_pidfile (str):    The location of the PID file.
+#                         Defaults to %%NAGIOSDIR%%/nrpe2.pid.
 #
 
 . %%RC_SUBR%%
@@ -23,7 +25,6 @@ rcvar=`set_rcvar`
 command="%%PREFIX%%/sbin/nrpe2"
 command_args="-d"
 extra_commands="reload"
-pidfile="%%NAGIOSDIR%%/nrpe2.pid"
 
 sig_reload=HUP
 
@@ -33,6 +34,7 @@ sig_reload=HUP
 
 load_rc_config "${name}"
 
+pidfile="${nrpe2_pidfile:-%%NAGIOSDIR%%/nrpe2.pid}"
 required_files="${nrpe2_configfile}"
 command_args="${command_args} -c ${nrpe2_configfile}"
 
-- 
1.6.0.4
--- add-knob-nrpe2_pidfile.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list