Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2013 12:00:44 GMT
From:      Daniel Ylitalo <daniel@203webgroup.se>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/183394: [patch] [databases/mongodb] Allow config to be specified in rc.conf
Message-ID:  <201310281200.r9SC0i0p088239@oldred.freebsd.org>
Resent-Message-ID: <201310281210.r9SCA15w070577@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         183394
>Category:       ports
>Synopsis:       [patch] [databases/mongodb] Allow config to be specified in rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 28 12:10:01 UTC 2013
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310281200.r9SC0i0p088239>