Bug 181201 - [patch] databases/redis - Allow you to set config path from rc.conf
Summary: [patch] databases/redis - Allow you to set config path from rc.conf
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
Depends on:
Reported: 2013-08-10 09:50 UTC by Daniel Ylitalo
Modified: 2014-03-13 21:20 UTC (History)
0 users

See Also:

file.diff (636 bytes, patch)
2013-08-10 09:50 UTC, Daniel Ylitalo
no flags Details | Diff
new-patch.txt (619 bytes, text/plain; charset=windows-1252)
2014-03-12 22:47 UTC, Daniel Ylitalo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ylitalo 2013-08-10 09:50:00 UTC
Many ports allows you to set the config path in /etc/rc.conf incase you don´t use the default path. This so when updating a port you don´t have to change the rc.d file itself after the update as it gets overwritten.

The attached patch allows you to do this.

Other ports that has this functionality is mysql55-server, openvpn, snmpd, nrpe2 among others.

Fix: See attached patch

Patch attached with submission follows:
How-To-Repeat: - Change the config path in /usr/local/etc/rc.d/redis
- Upgrade the port
- Your changes are missing
Comment 1 Edwin Groothuis freebsd_committer 2013-08-10 09:50:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->osa

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Daniel Ylitalo 2014-03-12 22:47:20 UTC
Attaching patch against current ports snapshot, if someone would mind 
taking a look at this it would be much appreciated. The PR is half a 
year old now.

Best regards
Comment 3 Matthias Andree freebsd_committer 2014-03-13 21:06:23 UTC
Responsible Changed
From-To: osa->mandree

take it (maintainer timeout)
Comment 4 dfilter service freebsd_committer 2014-03-13 21:13:47 UTC
Author: mandree
Date: Thu Mar 13 21:13:39 2014
New Revision: 348126
URL: http://svnweb.freebsd.org/changeset/ports/348126
QAT: https://qat.redports.org/buildarchive/r348126/

  Make configuration file path configurable in rc.conf. [1]
  Convert to stage support.  State which BSD license is meant. [2]
  PR:		ports/181201 [1]
  Submitted by:	Daniel Ylitalo <daniel@blodan.se> [1]
  Approved by:	maintainer timeout (osa, 6 months) [1]
  Approved by:	portmgr (blanket) [2]


Modified: head/databases/redis/Makefile
--- head/databases/redis/Makefile	Thu Mar 13 21:12:41 2014	(r348125)
+++ head/databases/redis/Makefile	Thu Mar 13 21:13:39 2014	(r348126)
@@ -3,13 +3,14 @@
 PORTNAME=	redis
 CATEGORIES=	databases
 MASTER_SITES=	http://download.redis.io/releases/
 MAINTAINER=	osa@FreeBSD.org
 COMMENT=	A persistent key-value database with built-in net interface
 LIB_DEPENDS=	libexecinfo.so:${PORTSDIR}/devel/libexecinfo
@@ -20,8 +21,6 @@ LUA_DESC=	Use lang/lua instead of builti
 LUAJIT_DESC=	Use lang/luajit instead of builtin lua
 TESTS_DESC=	Install lang/tcl for redis unit tests
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
@@ -85,14 +84,9 @@ post-build:
 		${WRKSRC}/redis.conf > ${WRKDIR}/redis.conf
-	${INSTALL_DATA} ${WRKDIR}/redis.conf ${PREFIX}/etc/redis.conf.sample
-	${INSTALL_DATA} ${WRKSRC}/sentinel.conf ${PREFIX}/etc/sentinel.conf.sample
-	[ -d ${d} ] || ${MKDIR} ${d} && ${CHOWN} ${USERS}:${GROUPS} ${d}
+	${INSTALL_DATA} ${WRKDIR}/redis.conf ${STAGEDIR}${PREFIX}/etc/redis.conf.sample
+	${INSTALL_DATA} ${WRKSRC}/sentinel.conf ${STAGEDIR}${PREFIX}/etc/sentinel.conf.sample
 regression-test: build
 	@cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl

Modified: head/databases/redis/files/redis.in
--- head/databases/redis/files/redis.in	Thu Mar 13 21:12:41 2014	(r348125)
+++ head/databases/redis/files/redis.in	Thu Mar 13 21:13:39 2014	(r348126)
@@ -21,14 +21,15 @@ rcvar=redis_enable
 # read configuration and set defaults
 load_rc_config "$name"
 : ${redis_enable="NO"}
 : ${redis_user="%%REDIS_USER%%"}
+: ${redis_config="%%PREFIX%%/etc/$name.conf"}
 run_rc_command "$1"
svn-ports-all@freebsd.org mailing list
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Matthias Andree freebsd_committer 2014-03-13 21:14:41 UTC
State Changed
From-To: open->closed

Committed, with other changes. Please check that you provide patches 
against sources if the installed file is generated (i. e. against the 
port's files/redis.in, rather than the generated $PREFIX/etc/rc.d/redis