aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwxs <wxs@FreeBSD.org>2008-10-29 09:01:34 +0800
committerwxs <wxs@FreeBSD.org>2008-10-29 09:01:34 +0800
commita54e946370b6ca72488650a2aa238cd9027ec885 (patch)
treec4a2883f73ca33ea5dded00818aae26f0a512bc4 /net
parent9c87d34a373f6a03f15189a5c1ddeaa8ed9dfacb (diff)
downloadfreebsd-ports-gnome-a54e946370b6ca72488650a2aa238cd9027ec885.tar.gz
freebsd-ports-gnome-a54e946370b6ca72488650a2aa238cd9027ec885.tar.zst
freebsd-ports-gnome-a54e946370b6ca72488650a2aa238cd9027ec885.zip
- Add UID and GID entries for net/rabbitmq.
- Convince RC script to use rabbitmq user. PR: ports/128108 Submitted by: Nick Barkas <snb@threerings.net> Approved by: Phillip N. <pneumann@gmail.com> (maintainer)
Diffstat (limited to 'net')
-rw-r--r--net/rabbitmq/Makefile12
-rw-r--r--net/rabbitmq/files/rabbitmq.in23
2 files changed, 15 insertions, 20 deletions
diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile
index e2ea0f1253d7..7546745df12c 100644
--- a/net/rabbitmq/Makefile
+++ b/net/rabbitmq/Makefile
@@ -7,7 +7,7 @@
PORTNAME= rabbitmq
PORTVERSION= 1.4.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= http://www.rabbitmq.com/releases/rabbitmq-server/v${PORTVERSION}/
DISTNAME= ${PORTNAME}-server-${PORTVERSION}
@@ -24,6 +24,9 @@ MAKE_ENV+= TARGET_DIR="${PREFIX}/lib/erlang/lib/rabbitmq_server-${PORTVERSION}"
SCRIPTS_DIR= ${WRKSRC}/scripts/
USE_RC_SUBR= rabbitmq
PLIST_SUB= "VERSION=${PORTVERSION}"
+SUB_FILES= pkg-install
+RABBITMQ_USER= rabbitmq
+RABBITMQ_GROUP= ${RABBITMQ_USER}
post-patch:
@${REINPLACE_CMD} -e 's|/etc/default|${PREFIX}/etc/rabbitmq|g ; s|/var/lib|/var/db|g ; s|erl|${PREFIX}/bin/erl|g' \
@@ -31,7 +34,10 @@ post-patch:
@${FIND} ${WRKSRC} -name "*.bak" | ${XARGS} ${RM}
-post-install:
- @${MKDIR} /var/log/rabbitmq /var/db/rabbitmq/mnesia ${PREFIX}/etc/rabbitmq
+pre-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+post-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
.include <bsd.port.mk>
diff --git a/net/rabbitmq/files/rabbitmq.in b/net/rabbitmq/files/rabbitmq.in
index 0b26934aebb3..1b8feab393e4 100644
--- a/net/rabbitmq/files/rabbitmq.in
+++ b/net/rabbitmq/files/rabbitmq.in
@@ -14,28 +14,17 @@
. "%%RC_SUBR%%"
+name=rabbitmq
+rcvar=`set_rcvar`
+
# Set some defaults
rabbitmq_enable=${rabbitmq_enable:-"NO"}
+rabbitmq_user=${rabbitmq_user:-"rabbitmq"}
prefix=%%PREFIX%%
-name=rabbitmq
-start_cmd="${name}_start"
-stop_cmd="${name}_stop"
-
-rabbitmq_start()
-{
- ${prefix}/sbin/rabbitmq-server -detached
- echo "RabbitMQ started"
-}
+start_cmd="env HOME=/var/db/rabbitmq su -m ${rabbitmq_user} -c 'sh -c \"${prefix}/sbin/rabbitmq-server -detached\"'"
+stop_cmd="env HOME=/var/db/rabbitmq su -m ${rabbitmq_user} -c 'sh -c \"${prefix}/sbin/rabbitmqctl stop\"'"
-rabbitmq_stop()
-{
- ${prefix}/sbin/rabbitmqctl stop
-}
-
-rcvar=`set_rcvar`
load_rc_config $name
-
-
run_rc_command "$1"