From nobody@FreeBSD.org  Mon Oct 28 12:00:45 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 141D326F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Oct 2013 12:00:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 01DA5292D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Oct 2013 12:00:45 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9SC0iC8088247
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Oct 2013 12:00:44 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9SC0i0p088239;
	Mon, 28 Oct 2013 12:00:44 GMT
	(envelope-from nobody)
Message-Id: <201310281200.r9SC0i0p088239@oldred.freebsd.org>
Date: Mon, 28 Oct 2013 12:00:44 GMT
From: Daniel Ylitalo <daniel@203webgroup.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] [databases/mongodb] Allow config to be specified in rc.conf
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183394
>Category:       ports
>Synopsis:       [patch] [databases/mongodb] Allow config to be specified in rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 28 12:10:01 UTC 2013
>Closed-Date:    Tue Oct 29 15:21:52 UTC 2013
>Last-Modified:  Tue Oct 29 15:21:52 UTC 2013
>Originator:     Daniel Ylitalo
>Release:        FreeBSD 9.1-RELEASE--p3
>Organization:
203 Webgroup AB
>Environment:
FreeBSD dev.p203.es 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Tue May  7 13:04:27 CEST 2013     root@dev.p203.es:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Right now the config path is hardcoded in the rc.d script, which will reset when upgrading.

Attached patch reads the config path from rc.conf if specified allowing easier upgrade.

This has been done for mysql/openvpn/nrpe/snmpd amongst others
>How-To-Repeat:
Change config path in rc.d/mongod and upgrade the software, the config path will be reset
>Fix:
Allow config path to be set in /etc/rc.conf, see attached patch.

Patch attached with submission follows:

--- mongod.orig 2013-10-28 12:50:39.000000000 +0100
+++ mongod      2013-10-28 12:51:20.000000000 +0100
@@ -31,10 +31,11 @@
 : ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"}
 : ${mongod_user="mongodb"}
 : ${mongod_group="mongodb"}
+: ${mongod_config="/usr/local/etc/mongodb.conf"}

 pidfile="${mongod_dbpath}/mongod.lock"
 command=/usr/local/bin/${name}
-command_args="--config /usr/local/etc/mongodb.conf --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null"
+command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null"
 start_precmd="${name}_prestart"

 mongod_create_dbpath()


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Oct 28 12:10:09 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183394 
State-Changed-From-To: open->feedback 
State-Changed-By: ale 
State-Changed-When: Mon Oct 28 15:53:12 UTC 2013 
State-Changed-Why:  
Why do you need to change the config location? The rc script doesn't allow multiple instances. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183394 

From: Daniel Ylitalo <daniel@203core.se>
To: bug-followup@FreeBSD.org, "daniel@203webgroup.se"
 <daniel@203webgroup.se>
Cc:  
Subject: Re: ports/183394: [patch] [databases/mongodb] Allow config to be
 specified in rc.conf
Date: Mon, 28 Oct 2013 17:51:28 +0100

 ----_com.android.email_1608626860054370
 Content-Type: text/plain; charset=utf-8
 Content-Transfer-Encoding: base64
 
 SGkhCgpCZWNhdXNlIGltIHVzaW5nIGEgZGVwbG95c3lzdGVtIHdoaWNoIHN0b3JlcyBhbGwgY29u
 ZmlncyBpbiBhIHN2biByZXBv
 
 ----_com.android.email_1608626860054370
 Content-Type: text/html; charset=utf-8
 Content-Transfer-Encoding: base64
 
 PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0
 L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPjwvaGVhZD48Ym9keSA+PGRpdj5IaSE8L2Rpdj48ZGl2Pjxi
 cj48L2Rpdj48ZGl2PkJlY2F1c2UgaW0gdXNpbmcgYSBkZXBsb3lzeXN0ZW0gd2hpY2ggc3RvcmVz
 IGFsbCBjb25maWdzIGluIGEgc3ZuIHJlcG88L2Rpdj48L2JvZHk+PC9odG1sPg==
 
 ----_com.android.email_1608626860054370--
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: ale 
State-Changed-When: Tue Oct 29 15:21:13 UTC 2013 
State-Changed-Why:  
Then simply create a symlink from etc/mongod.conf to your config file. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183394 
>Unformatted:
