Bug 186837 - [PATCH] net-mgmt/nrpe rc.d script uses hardcoded path
Summary: [PATCH] net-mgmt/nrpe rc.d script uses hardcoded path
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Matthias Andree
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 13:00 UTC by Daniel Ylitalo
Modified: 2014-03-13 21:30 UTC (History)
0 users

See Also:


Attachments
file.diff (522 bytes, patch)
2014-02-17 13:00 UTC, Daniel Ylitalo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ylitalo 2014-02-17 13:00:00 UTC
The nrpe2 rc.d file allows a user to change the location of the nrpe.cfg file.

If one were to do so the find_pidfile() function is hardcoded to look in the location of the default path.

Attaching patch.

Fix: See attached patch

Patch attached with submission follows:
How-To-Repeat: Change the location of the nrpe.cfg file in /etc/rc.conf with:
nrpe2_configfile="/your/random/location/nrpe.cfg"
and then move the default file there and try to restart nrpe2
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2014-02-17 15:14:05 UTC
Responsible Changed
From-To: freebsd-ports-bugs->zeising

Over to maintainer.
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2014-03-13 21:16:35 UTC
Responsible Changed
From-To: zeising->mandree

Take it, per discussion on IRC yesterday.
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-03-13 21:24:08 UTC
Author: mandree
Date: Thu Mar 13 21:24:01 2014
New Revision: 348129
URL: http://svnweb.freebsd.org/changeset/ports/348129
QAT: https://qat.redports.org/buildarchive/r348129/

Log:
  Fix acquisition of pidfile location.
  
  PR:		ports/186837
  Submitted by:	Daniel Ylitalo <daniel@203webgroup.se>
  Approved by:	zeising (maintainer)

Modified:
  head/net-mgmt/nrpe/files/nrpe2.in

Modified: head/net-mgmt/nrpe/files/nrpe2.in
==============================================================================
--- head/net-mgmt/nrpe/files/nrpe2.in	Thu Mar 13 21:22:11 2014	(r348128)
+++ head/net-mgmt/nrpe/files/nrpe2.in	Thu Mar 13 21:24:01 2014	(r348129)
@@ -37,7 +37,7 @@ find_pidfile()
 	[ -n "$nrpe2_pidfile" ] &&
 	    warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]"
 
-	if get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then
+	if get_pidfile_from_conf pid_file ${nrpe2_configfile}; then
 		pidfile="$_pidfile_from_conf"
 	else
 		pidfile='%%PIDDIR%%/nrpe2.pid'
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2014-03-13 21:24:32 UTC
State Changed
From-To: open->closed

Committed.  Please make sure that you provide patches for source files, 
not the output files - most rc.d files are generated files, and 
providing patches for the output is useless.