summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Powell <steve@rabbitmq.com>2012-02-02 10:41:26 +0000
committerSteve Powell <steve@rabbitmq.com>2012-02-02 10:41:26 +0000
commit040c1612386de3c9319dc1c139659edfecd57604 (patch)
tree3934d3e504183a600a3ae54906e6415a9847bf01
parenteca129d8b936472c5c3dd280feca40fcb8d2e3bd (diff)
parent0dc005814ae7575b84099ecb42c7399c22094090 (diff)
downloadrabbitmq-server-040c1612386de3c9319dc1c139659edfecd57604.tar.gz
Merge default in.
-rw-r--r--Makefile2
-rw-r--r--packaging/generic-unix/Makefile3
-rw-r--r--packaging/generic-unix/rabbitmq-sys32
-rwxr-xr-xscripts/rabbitmq-env11
-rwxr-xr-xscripts/rabbitmq-plugins7
-rwxr-xr-xscripts/rabbitmq-server37
-rw-r--r--scripts/rabbitmq-sys30
-rwxr-xr-xscripts/rabbitmqctl6
8 files changed, 103 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 31c71dd4..4ae0763f 100644
--- a/Makefile
+++ b/Makefile
@@ -316,7 +316,7 @@ install_bin: all install_dirs
cp -r ebin include LICENSE* INSTALL $(TARGET_DIR)
chmod 0755 scripts/*
- for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugins; do \
+ for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugins rabbitmq-sys; do \
cp scripts/$$script $(TARGET_DIR)/sbin; \
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
done
diff --git a/packaging/generic-unix/Makefile b/packaging/generic-unix/Makefile
index b5c342aa..dac28b84 100644
--- a/packaging/generic-unix/Makefile
+++ b/packaging/generic-unix/Makefile
@@ -12,6 +12,9 @@ dist:
MAN_DIR=`pwd`/$(TARGET_DIR)/share/man \
install
+ cp -f rabbitmq-sys $(TARGET_DIR)/sbin
+ chmod 0755 $(TARGET_DIR)/sbin/rabbitmq-sys
+
tar -zcf $(TARGET_TARBALL).tar.gz $(TARGET_DIR)
rm -rf $(SOURCE_DIR) $(TARGET_DIR)
diff --git a/packaging/generic-unix/rabbitmq-sys b/packaging/generic-unix/rabbitmq-sys
new file mode 100644
index 00000000..efd20766
--- /dev/null
+++ b/packaging/generic-unix/rabbitmq-sys
@@ -0,0 +1,32 @@
+#!/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 Developer of the Original Code is VMware, Inc.
+## Copyright (c) 2012 VMware, Inc. All rights reserved.
+##
+
+### generic-unix ###
+
+## Set system default values
+SERVER_ERL_ARGS="+K true +A30 +P 1048576 \
+-kernel inet_default_connect_options [{nodelay,true}]"
+
+CONFIG_FILE=${RABBITMQ_HOME}/rabbitmq
+
+LOG_BASE=${RABBITMQ_HOME}/log
+
+MNESIA_BASE=${RABBITMQ_HOME}/mnesia
+
+PLUGINS_DIR=${RABBITMQ_HOME}/plugins
+
+ENABLED_PLUGINS_FILE=${RABBITMQ_HOME}/enabled_plugins
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index a2ef8d3c..dd7abd34 100755
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -36,7 +36,16 @@ RABBITMQ_HOME="${SCRIPT_DIR}/.."
[ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname`
NODENAME=rabbit@${HOSTNAME%%.*}
-# Load configuration from the rabbitmq.conf file
+## Set system default values for rabbitmq-env.conf variables to override
+if [ ! -f ${SCRIPT_DIR}/rabbitmq-sys ]; then
+ echo -n "WARNING: system defaults are not available -- "
+ echo "check the installation completed correctly."
+ exit 1
+fi
+
+. ${SCRIPT_DIR}/rabbitmq-sys
+
+## Get configuration variables from the rabbitmq-env.conf file
if [ -f /etc/rabbitmq/rabbitmq.conf ] && \
[ ! -f /etc/rabbitmq/rabbitmq-env.conf ] ; then
echo -n "WARNING: ignoring /etc/rabbitmq/rabbitmq.conf -- "
diff --git a/scripts/rabbitmq-plugins b/scripts/rabbitmq-plugins
index 4c6cb1fa..247cbfe2 100755
--- a/scripts/rabbitmq-plugins
+++ b/scripts/rabbitmq-plugins
@@ -15,13 +15,16 @@
## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
##
+# Get default settings with user overrides for (RABBITMQ_)<var_name>
+# Non-empty defaults should be set in rabbitmq-env
. `dirname $0`/rabbitmq-env
-ENABLED_PLUGINS_FILE=/etc/rabbitmq/enabled_plugins
+##--- Set environment vars RABBITMQ_<var_name> to defaults if not set
[ "x" = "x$RABBITMQ_ENABLED_PLUGINS_FILE" ] && RABBITMQ_ENABLED_PLUGINS_FILE=${ENABLED_PLUGINS_FILE}
+[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR=${PLUGINS_DIR}
-[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+##--- End of overridden <var_name> variables
exec erl \
-pa "${RABBITMQ_HOME}/ebin" \
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server
index 39a68c8e..a191805f 100755
--- a/scripts/rabbitmq-server
+++ b/scripts/rabbitmq-server
@@ -15,30 +15,20 @@
## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
##
-SERVER_ERL_ARGS="+K true +A30 +P 1048576 \
--kernel inet_default_connect_options [{nodelay,true}]"
-CONFIG_FILE=/etc/rabbitmq/rabbitmq
-LOG_BASE=/var/log/rabbitmq
-MNESIA_BASE=/var/lib/rabbitmq/mnesia
-SERVER_START_ARGS=
-ENABLED_PLUGINS_FILE=/etc/rabbitmq/enabled_plugins
-
+# Get default settings with user overrides for (RABBITMQ_)<var_name>
+# Non-empty defaults should be set in rabbitmq-env
. `dirname $0`/rabbitmq-env
+##--- Set environment vars RABBITMQ_<var_name> to defaults if not set
+
DEFAULT_NODE_IP_ADDRESS=auto
DEFAULT_NODE_PORT=5672
-[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" != "x$NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS}
-[ "x" = "x$RABBITMQ_NODE_PORT" ] && [ "x" != "x$NODE_PORT" ] && RABBITMQ_NODE_PORT=${NODE_PORT}
-if [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ]
-then
- if [ "x" != "x$RABBITMQ_NODE_PORT" ]
- then RABBITMQ_NODE_IP_ADDRESS=${DEFAULT_NODE_IP_ADDRESS}
- fi
-else
- if [ "x" = "x$RABBITMQ_NODE_PORT" ]
- then RABBITMQ_NODE_PORT=${DEFAULT_NODE_PORT}
- fi
-fi
+[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS}
+[ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${NODE_PORT}
+
+[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" != "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_IP_ADDRESS=${DEFAULT_NODE_IP_ADDRESS}
+[ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${DEFAULT_NODE_PORT}
+
[ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME}
[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS}
[ "x" = "x$RABBITMQ_CONFIG_FILE" ] && RABBITMQ_CONFIG_FILE=${CONFIG_FILE}
@@ -48,13 +38,16 @@ fi
[ "x" = "x$RABBITMQ_MNESIA_DIR" ] && RABBITMQ_MNESIA_DIR=${MNESIA_DIR}
[ "x" = "x$RABBITMQ_MNESIA_DIR" ] && RABBITMQ_MNESIA_DIR=${RABBITMQ_MNESIA_BASE}/${RABBITMQ_NODENAME}
+
+[ "x" = "x$RABBITMQ_PID_FILE" ] && RABBITMQ_PID_FILE=${PID_FILE}
[ "x" = "x$RABBITMQ_PID_FILE" ] && RABBITMQ_PID_FILE=${RABBITMQ_MNESIA_DIR}.pid
[ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR=${PLUGINS_EXPAND_DIR}
[ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR=${RABBITMQ_MNESIA_BASE}/${RABBITMQ_NODENAME}-plugins-expand
[ "x" = "x$RABBITMQ_ENABLED_PLUGINS_FILE" ] && RABBITMQ_ENABLED_PLUGINS_FILE=${ENABLED_PLUGINS_FILE}
-[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+
+[ "x" = "x$RABBITMQ_PLUGINS_DIR" ] && RABBITMQ_PLUGINS_DIR=${PLUGINS_DIR}
## Log rotation
[ "x" = "x$RABBITMQ_LOGS" ] && RABBITMQ_LOGS=${LOGS}
@@ -62,6 +55,8 @@ fi
[ "x" = "x$RABBITMQ_SASL_LOGS" ] && RABBITMQ_SASL_LOGS=${SASL_LOGS}
[ "x" = "x$RABBITMQ_SASL_LOGS" ] && RABBITMQ_SASL_LOGS="${RABBITMQ_LOG_BASE}/${RABBITMQ_NODENAME}-sasl.log"
+##--- End of overridden <var_name> variables
+
RABBITMQ_START_RABBIT=
[ "x" = "x$RABBITMQ_ALLOW_INPUT" ] && RABBITMQ_START_RABBIT='-noinput'
diff --git a/scripts/rabbitmq-sys b/scripts/rabbitmq-sys
new file mode 100644
index 00000000..c58341ef
--- /dev/null
+++ b/scripts/rabbitmq-sys
@@ -0,0 +1,30 @@
+#!/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 Developer of the Original Code is VMware, Inc.
+## Copyright (c) 2012 VMware, Inc. All rights reserved.
+##
+
+## Set system default values
+SERVER_ERL_ARGS="+K true +A30 +P 1048576 \
+-kernel inet_default_connect_options [{nodelay,true}]"
+
+CONFIG_FILE=/etc/rabbitmq/rabbitmq
+
+LOG_BASE=/var/log/rabbitmq
+
+MNESIA_BASE=/var/lib/rabbitmq/mnesia
+
+PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+
+ENABLED_PLUGINS_FILE=/etc/rabbitmq/enabled_plugins
diff --git a/scripts/rabbitmqctl b/scripts/rabbitmqctl
index 9a11c3b3..887eeac6 100755
--- a/scripts/rabbitmqctl
+++ b/scripts/rabbitmqctl
@@ -15,11 +15,17 @@
## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
##
+# Get default settings with user overrides for (RABBITMQ_)<var_name>
+# Non-empty defaults should be set in rabbitmq-env
. `dirname $0`/rabbitmq-env
+##--- Set environment vars RABBITMQ_<var_name> to defaults if not set
+
[ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME}
[ "x" = "x$RABBITMQ_CTL_ERL_ARGS" ] && RABBITMQ_CTL_ERL_ARGS=${CTL_ERL_ARGS}
+##--- End of overridden <var_name> variables
+
exec erl \
-pa "${RABBITMQ_HOME}/ebin" \
-noinput \