aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GIDs1
-rw-r--r--UIDs1
-rw-r--r--net/rabbitmq/Makefile12
-rw-r--r--net/rabbitmq/files/rabbitmq.in23
4 files changed, 17 insertions, 20 deletions
diff --git a/GIDs b/GIDs
index 22f17bc5f63a..abfb6af80132 100644
--- a/GIDs
+++ b/GIDs
@@ -66,6 +66,7 @@ _ospfd:*:131:
_spamd:*:132:
freeradius:*:133:
undernet:*:134:
+rabbitmq:*:135:
dovecot:*:143:
rbldns:*:153:
sfs:*:171:
diff --git a/UIDs b/UIDs
index 0ef35d8c5405..896cf23ac013 100644
--- a/UIDs
+++ b/UIDs
@@ -74,6 +74,7 @@ _ospfd:*:131:131::0:0:OSPF Daemon:/var/empty:/usr/sbin/nologin
_spamd:*:132:132::0:0:Spam Daemon:/var/empty:/usr/sbin/nologin
freeradius:*:133:133::0:0:FreeRADIUS Daemon:/nonexistent:/usr/sbin/nologin
undernet:*:134:134::0:0:Undernet ircu Daemon:/nonexistant:/usr/sbin/nologin
+rabbitmq:*:135:135::0:0:RabbitMQ:/var/db/rabbitmq:/usr/sbin/nologin
cricket:*:141:80::0:0:Cricket Monitoring User:/usr/local/cricket:/usr/sbin/nologin
dovecot:*:143:143::0:0:Dovecot User:/var/empty:/usr/sbin/nologin
rbldns:*:153:153::0:0:rbldnsd pseudo-user:/nonexistent:/usr/sbin/nologin
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"