summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-10-29 13:43:03 +0000
committerMatthew Sackman <matthew@lshift.net>2009-10-29 13:43:03 +0000
commit587a8da97e2df7370df757d73e6b97156f7dfe7b (patch)
tree8fbce6bc18fd76d0869b871b5955c557bc357efc /packaging
parente13ef6f44f474a22861ce27fac356323b93daaa5 (diff)
downloadrabbitmq-server-git-587a8da97e2df7370df757d73e6b97156f7dfe7b.tar.gz
Made the wrappers slightly smarter so that they also detect when they're the rabbitmq user and just pass args straight through in this case (which, after testing, really is the right thing to do). Note that at least on debian, the rabbitmq user has the shell of /bin/false, so shouldn't be able to log in, but even so, either edit that to /bin/sh and then su to rabbitmq and then rabbitmqctl list_queues works, or su rabbitmq -s /bin/sh -c "/usr/sbin/rabbitmqctl list_queues" works. In short, it seems to work.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/common/rabbitmq-script-wrapper6
-rw-r--r--packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper4
2 files changed, 7 insertions, 3 deletions
diff --git a/packaging/common/rabbitmq-script-wrapper b/packaging/common/rabbitmq-script-wrapper
index 0c4bd0a8d7..4c3ff35b33 100644
--- a/packaging/common/rabbitmq-script-wrapper
+++ b/packaging/common/rabbitmq-script-wrapper
@@ -44,11 +44,13 @@ cd /var/lib/rabbitmq
SCRIPT=`basename $0`
-if [ `id -u` = 0 ] ; then
+if [ `id -u` == 0 ] ; then
su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
+elif [ `id -u` = `id -u rabbitmq` ] ; then
+ /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
else
/usr/lib/rabbitmq/bin/${SCRIPT}
- echo -e "\nOnly root should run ${SCRIPT}\n"
+ echo -e "\nOnly root or rabbitmq should run ${SCRIPT}\n"
exit 1
fi
diff --git a/packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper b/packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper
index 0d7118c476..80cb7bd53c 100644
--- a/packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper
+++ b/packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper
@@ -5,9 +5,11 @@ SCRIPT=`basename $0`
if [ `id -u` = 0 ] ; then
sudo -u rabbitmq -H /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
+elif [ `id -u` = `id -u rabbitmq` ] ; then
+ /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
else
/usr/lib/rabbitmq/bin/${SCRIPT}
- echo -e "\nOnly root should run ${SCRIPT}\n"
+ echo -e "\nOnly root or rabbitmq should run ${SCRIPT}\n"
exit 1
fi