diff options
author | Wesley Shields <wxs@FreeBSD.org> | 2008-10-29 01:02:22 +0000 |
---|---|---|
committer | Wesley Shields <wxs@FreeBSD.org> | 2008-10-29 01:02:22 +0000 |
commit | 14fda81e71b66e1b7348f0be6c656619ea1009d8 (patch) | |
tree | c2d0f80b00e271bbb26794160afc5d2e0a12cafd /net/rabbitmq | |
parent | 286741f08ddf54a8762422df7e3636a0857c7f90 (diff) | |
download | ports-14fda81e71b66e1b7348f0be6c656619ea1009d8.tar.gz ports-14fda81e71b66e1b7348f0be6c656619ea1009d8.zip |
Notes
Diffstat (limited to 'net/rabbitmq')
-rw-r--r-- | net/rabbitmq/files/pkg-install.in | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/net/rabbitmq/files/pkg-install.in b/net/rabbitmq/files/pkg-install.in new file mode 100644 index 000000000000..6dc6a8397ca5 --- /dev/null +++ b/net/rabbitmq/files/pkg-install.in @@ -0,0 +1,41 @@ +#!/bin/sh + +RABBITMQ_USER=rabbitmq +RABBITMQ_GROUP=${RABBITMQ_USER} +RABBITMQ_UID=135 +RABBITMQ_GID=${RABBITMQ_UID} + +case $2 in +PRE-INSTALL) + + if ! pw group show "${RABBITMQ_GROUP}" > /dev/null; then + if pw groupadd ${RABBITMQ_GROUP} -g ${RABBITMQ_GID}; then + echo "Added group \"${RABBITMQ_GROUP}\"." + else + echo "Adding group \"${RABBITMQ_GROUP}\" failed..." + exit 1 + fi + fi + + if ! pw user show "${RABBITMQ_USER}" > /dev/null; then + if pw useradd ${RABBITMQ_USER} -u ${RABBITMQ_UID} \ + -g ${RABBITMQ_GROUP} -h - -d /var/db/rabbitmq \ + -s /usr/sbin/nologin -c "RabbitMQ" + then + echo "Added user \"${RABBITMQ_USER}\"." + else + echo "Adding user \"${RABBITMQ_USER}\" failed..." + exit 1 + fi + fi +;; + +POST-INSTALL) + mkdir -p %%PREFIX%%/etc/rabbitmq + mkdir -p /var/db/rabbitmq/mnesia + mkdir -p /var/log/rabbitmq + chown -R ${RABBITMQ_USER}:${RABBITMQ_GROUP} /var/db/rabbitmq + chown -R ${RABBITMQ_USER}:${RABBITMQ_GROUP} /var/log/rabbitmq +;; + +esac |