summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jones <paulj@lshift.net>2009-07-29 12:50:02 +0100
committerPaul Jones <paulj@lshift.net>2009-07-29 12:50:02 +0100
commit00ac346afc648ce6a4df3e34d726a13a0206e0fc (patch)
treed42d2a44a318e3d516a56a5bd4d75c637a6ef01e
parent4f8af96dcb459b0a637b3ad88256af0a00b8c91d (diff)
downloadrabbitmq-server-00ac346afc648ce6a4df3e34d726a13a0206e0fc.tar.gz
Renamed activate-plugins to rabbitmq-activate-plugins; changed scripts to use rabbitmq-env to source paths instead of embedding the logic themselves
-rw-r--r--Makefile2
-rwxr-xr-xscripts/rabbitmq-activate-plugins47
-rw-r--r--scripts/rabbitmq-activate-plugins.bat (renamed from scripts/activate-plugins.bat)0
-rwxr-xr-xscripts/rabbitmq-env (renamed from scripts/activate-plugins)19
-rwxr-xr-xscripts/rabbitmq-multi16
-rwxr-xr-xscripts/rabbitmq-server16
-rwxr-xr-xscripts/rabbitmqctl16
7 files changed, 58 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index 9e599597..5f1e1c92 100644
--- a/Makefile
+++ b/Makefile
@@ -172,7 +172,7 @@ install: all docs_all install_dirs
cp -r ebin include LICENSE LICENSE-MPL-RabbitMQ INSTALL $(TARGET_DIR)
chmod 0755 scripts/*
- for script in rabbitmq-server rabbitmqctl rabbitmq-multi activate-plugins; do \
+ for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-multi rabbitmq-activate-plugins; do \
cp scripts/$$script $(TARGET_DIR)/sbin; \
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
done
diff --git a/scripts/rabbitmq-activate-plugins b/scripts/rabbitmq-activate-plugins
new file mode 100755
index 00000000..5ce64c68
--- /dev/null
+++ b/scripts/rabbitmq-activate-plugins
@@ -0,0 +1,47 @@
+#!/bin/sh
+## The contents of this file are subject to the Mozilla Public License
+## Version 1.1 (the "License"); you may not use this file except in
+## compliance with the License. You may obtain a copy of the License at
+## http://www.mozilla.org/MPL/
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+## License for the specific language governing rights and limitations
+## under the License.
+##
+## The Original Code is RabbitMQ.
+##
+## The Initial Developers of the Original Code are LShift Ltd,
+## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
+##
+## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
+## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
+## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
+## Technologies LLC, and Rabbit Technologies Ltd.
+##
+## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+## Ltd. Portions created by Cohesive Financial Technologies LLC are
+## Copyright (C) 2007-2009 Cohesive Financial Technologies
+## LLC. Portions created by Rabbit Technologies Ltd are Copyright
+## (C) 2007-2009 Rabbit Technologies Ltd.
+##
+## All Rights Reserved.
+##
+## Contributor(s): ______________________________________.
+##
+
+. `dirname $0`/rabbitmq-env
+
+RABBITMQ_EBIN=${RABBITMQ_HOME}/ebin
+[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+[ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR="${RABBITMQ_HOME}/priv/plugins"
+
+exec erl \
+ -pa "$RABBITMQ_EBIN" \
+ -rabbit plugins_dir "\"$RABBITMQ_PLUGINS_DIR\"" \
+ -rabbit plugins_expand_dir "\"$RABBITMQ_PLUGINS_EXPAND_DIR\"" \
+ -rabbit rabbit_ebin "\"$RABBITMQ_EBIN\"" \
+ -noinput \
+ -hidden \
+ -s rabbit_plugin_activator \
+ -extra "$@"
diff --git a/scripts/activate-plugins.bat b/scripts/rabbitmq-activate-plugins.bat
index 8bef4ad2..8bef4ad2 100644
--- a/scripts/activate-plugins.bat
+++ b/scripts/rabbitmq-activate-plugins.bat
diff --git a/scripts/activate-plugins b/scripts/rabbitmq-env
index 536b5d35..9ffa7302 100755
--- a/scripts/activate-plugins
+++ b/scripts/rabbitmq-env
@@ -30,6 +30,7 @@
## Contributor(s): ______________________________________.
##
+# Determine where this script is really located
SCRIPT_PATH="$0"
while [ -h "$SCRIPT_PATH" ] ; do
ls=`ls -ld "$SCRIPT_PATH"`
@@ -40,21 +41,9 @@ while [ -h "$SCRIPT_PATH" ] ; do
SCRIPT_PATH="`dirname "$SCRIPT_PATH"`/$link"
fi
done
+
SCRIPT_DIR=`dirname $SCRIPT_PATH`
+RABBITMQ_HOME="${SCRIPT_DIR}/.."
+# Load configuration from the rabbitmq.conf file
[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf
-
-RABBITMQ_EBIN=${SCRIPT_DIR}/../ebin
-echo $RABBITMQ_EBIN
-[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR="${SCRIPT_DIR}/../plugins"
-[ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR="${SCRIPT_DIR}/../priv/plugins"
-
-exec erl \
- -pa "$RABBITMQ_EBIN" \
- -rabbit plugins_dir "\"$RABBITMQ_PLUGINS_DIR\"" \
- -rabbit plugins_expand_dir "\"$RABBITMQ_PLUGINS_EXPAND_DIR\"" \
- -rabbit rabbit_ebin "\"$RABBITMQ_EBIN\"" \
- -noinput \
- -hidden \
- -s rabbit_plugin_activator \
- -extra "$@"
diff --git a/scripts/rabbitmq-multi b/scripts/rabbitmq-multi
index 129a202d..7db4cb70 100755
--- a/scripts/rabbitmq-multi
+++ b/scripts/rabbitmq-multi
@@ -37,19 +37,7 @@ PIDS_FILE=/var/lib/rabbitmq/pids
MULTI_ERL_ARGS=
MULTI_START_ARGS=
-SCRIPT_PATH="$0"
-while [ -h "$SCRIPT_PATH" ] ; do
- ls=`ls -ld "$SCRIPT_PATH"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- SCRIPT_PATH="$link"
- else
- SCRIPT_PATH="`dirname "$SCRIPT_PATH"`/$link"
- fi
-done
-SCRIPT_DIR=`dirname $SCRIPT_PATH`
-
-[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf
+. `dirname $0`/rabbitmq-env
[ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME}
[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS}
@@ -72,7 +60,7 @@ export \
set -f
exec erl \
- -pa "${SCRIPT_DIR}/../ebin" \
+ -pa "${RABBITMQ_HOME}/ebin" \
-noinput \
-hidden \
${RABBITMQ_MULTI_ERL_ARGS} \
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server
index 41e27352..e70fd046 100755
--- a/scripts/rabbitmq-server
+++ b/scripts/rabbitmq-server
@@ -41,19 +41,7 @@ LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
SERVER_START_ARGS=
-SCRIPT_PATH="$0"
-while [ -h "$SCRIPT_PATH" ] ; do
- ls=`ls -ld "$SCRIPT_PATH"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- SCRIPT_PATH="$link"
- else
- SCRIPT_PATH="`dirname "$SCRIPT_PATH"`/$link"
- fi
-done
-SCRIPT_DIR=`dirname $SCRIPT_PATH`
-
-[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf
+. `dirname $0`/rabbitmq-env
[ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME}
[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS}
@@ -87,7 +75,7 @@ fi
RABBITMQ_START_RABBIT=
[ "x" = "x$RABBITMQ_NODE_ONLY" ] && RABBITMQ_START_RABBIT='-noinput -s rabbit'
-RABBITMQ_EBIN_ROOT="${SCRIPT_DIR}/../ebin"
+RABBITMQ_EBIN_ROOT="${RABBITMQ_HOME}/ebin"
if [ -f "${RABBITMQ_EBIN_ROOT}/rabbit.boot" ]; then
RABBITMQ_BOOT_FILE="${RABBITMQ_EBIN_ROOT}/rabbit"
RABBITMQ_EBIN_PATH=""
diff --git a/scripts/rabbitmqctl b/scripts/rabbitmqctl
index 88206abc..9c45e73d 100755
--- a/scripts/rabbitmqctl
+++ b/scripts/rabbitmqctl
@@ -30,24 +30,12 @@
## Contributor(s): ______________________________________.
##
-SCRIPT_PATH="$0"
-while [ -h "$SCRIPT_PATH" ] ; do
- ls=`ls -ld "$SCRIPT_PATH"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- SCRIPT_PATH="$link"
- else
- SCRIPT_PATH="`dirname "$SCRIPT_PATH"`/$link"
- fi
-done
-SCRIPT_DIR=`dirname $SCRIPT_PATH`
-
-[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf
+. `dirname $0`/rabbitmq-env
[ "x" = "x$RABBITMQ_CTL_ERL_ARGS" ] && RABBITMQ_CTL_ERL_ARGS=${CTL_ERL_ARGS}
exec erl \
- -pa "${SCRIPT_DIR}/../ebin" \
+ -pa "${RABBITMQ_HOME}/ebin" \
-noinput \
-hidden \
${RABBITMQ_CTL_ERL_ARGS} \