summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Powell <steve@rabbitmq.com>2012-02-24 11:19:00 +0000
committerSteve Powell <steve@rabbitmq.com>2012-02-24 11:19:00 +0000
commit8024319f97d75d4b3290e78715a5a9a7cf29ed07 (patch)
treef6b889dc2f170e37c5e9e986a9924eb9296eb282
parentffc96cd132e6bcbd1ab72e84f63575a5cb9d9508 (diff)
downloadrabbitmq-server-8024319f97d75d4b3290e78715a5a9a7cf29ed07.tar.gz
Get generic-unix sys-defaults to check for global locations
(and rename rabbitmq-locations to rabbitmq-sys-defaults).
-rw-r--r--packaging/generic-unix/Makefile4
-rw-r--r--packaging/generic-unix/rabbitmq-sys-defaults (renamed from packaging/generic-unix/rabbitmq-locations)20
-rw-r--r--packaging/macports/Portfile.in4
-rwxr-xr-xscripts/rabbitmq-env12
-rw-r--r--scripts/rabbitmq-sys-defaults (renamed from scripts/rabbitmq-locations)5
5 files changed, 26 insertions, 19 deletions
diff --git a/packaging/generic-unix/Makefile b/packaging/generic-unix/Makefile
index 5989d5c0..50298219 100644
--- a/packaging/generic-unix/Makefile
+++ b/packaging/generic-unix/Makefile
@@ -12,8 +12,8 @@ dist:
MAN_DIR=`pwd`/$(TARGET_DIR)/share/man \
install
- cp -f rabbitmq-locations $(TARGET_DIR)/sbin
- chmod 0755 $(TARGET_DIR)/sbin/rabbitmq-locations
+ cp -f rabbitmq-sys-defaults $(TARGET_DIR)/sbin
+ chmod 0755 $(TARGET_DIR)/sbin/rabbitmq-sys-defaults
mkdir -p $(TARGET_DIR)/etc/rabbitmq
diff --git a/packaging/generic-unix/rabbitmq-locations b/packaging/generic-unix/rabbitmq-sys-defaults
index 8812f8d2..279c6495 100644
--- a/packaging/generic-unix/rabbitmq-locations
+++ b/packaging/generic-unix/rabbitmq-sys-defaults
@@ -19,16 +19,22 @@
### next line potentially updated in package install steps
SYS_PREFIX=${RABBITMQ_HOME}
+check_and_set_rabbitmq_file_location() {
+ # $1 - var name (set), $2 - global location, $3 - optional suffix for check
+ [ -f $2$3 ] && [ ! -f ${SYS_PREFIX}$2$3 ] && \
+ echo "WARNING: $1 default is ${SYS_PREFIX}$2, ignoring $2"
+ eval "$1=${SYS_PREFIX}$2"
+}
+
## Set system default values
SERVER_ERL_ARGS="+K true +A30 +P 1048576 \
-kernel inet_default_connect_options [{nodelay,true}]"
-CONFIG_FILE=${SYS_PREFIX}/etc/rabbitmq/rabbitmq
-LOG_BASE=${SYS_PREFIX}/var/log/rabbitmq
-MNESIA_BASE=${SYS_PREFIX}/var/lib/rabbitmq/mnesia
-ENABLED_PLUGINS_FILE=${SYS_PREFIX}/etc/rabbitmq/enabled_plugins
-
-OLD_CONF_ENV_FILE=/etc/rabbitmq/rabbitmq.conf
-CONF_ENV_FILE=${SYS_PREFIX}/etc/rabbitmq/rabbitmq-env.conf
+check_and_set_rabbitmq_file_location CONF_ENV_FILE /etc/rabbitmq/rabbitmq-env.conf
+check_and_set_rabbitmq_file_location CONFIG_FILE /etc/rabbitmq/rabbitmq .config
+check_and_set_rabbitmq_file_location ENABLED_PLUGINS_FILE /etc/rabbitmq/enabled-plugins
+check_and_set_rabbitmq_file_location LOG_BASE /var/log/rabbitmq
+check_and_set_rabbitmq_file_location MNESIA_BASE /var/lib/rabbitmq/mnesia
PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+
diff --git a/packaging/macports/Portfile.in b/packaging/macports/Portfile.in
index cae0ebf3..59e7f38c 100644
--- a/packaging/macports/Portfile.in
+++ b/packaging/macports/Portfile.in
@@ -91,9 +91,9 @@ post-destroot {
xinstall -d -g [existsgroup ${servergroup}] -m 775 ${destroot}${mnesiadbdir}
reinplace -E "s:^SYS_PREFIX=\${RABBITMQ_HOME}$:SYS_PREFIX=${prefix}:" \
- ${realsbin}/rabbitmq-locations
+ ${realsbin}/rabbitmq-sys-defaults
reinplace -E "s:^SYS_PREFIX=$:SYS_PREFIX=${prefix}:" \
- ${realsbin}/rabbitmq-locations
+ ${realsbin}/rabbitmq-sys-defaults
xinstall -m 555 ${filespath}/rabbitmq-script-wrapper \
${wrappersbin}/rabbitmq-server
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index 3eb69524..80e34e81 100755
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -36,13 +36,15 @@ RABBITMQ_HOME="${SCRIPT_DIR}/.."
[ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname`
NODENAME=rabbit@${HOSTNAME%%.*}
-## Get system default locations
-. ${SCRIPT_DIR}/rabbitmq-locations
+## Get system defaults
+. ${SCRIPT_DIR}/rabbitmq-sys-defaults
-## Get configuration variables from the configure environment file
-if [ -f ${OLD_CONF_ENV_FILE} ] && \
+# warn about old rabbitmq.conf file, if no new one
+if [ -f /etc/rabbitmq/rabbitmq.conf ] && \
[ ! -f ${CONF_ENV_FILE} ] ; then
- echo -n "WARNING: ignoring ${OLD_CONF_ENV_FILE} -- "
+ echo -n "WARNING: ignoring /etc/rabbitmq/rabbitmq.conf -- "
echo "location has moved to ${CONF_ENV_FILE}"
fi
+
+## Get configuration variables from the configure environment file
[ -f ${CONF_ENV_FILE} ] && . ${CONF_ENV_FILE}
diff --git a/scripts/rabbitmq-locations b/scripts/rabbitmq-sys-defaults
index 7b7dfa59..a425f923 100644
--- a/scripts/rabbitmq-locations
+++ b/scripts/rabbitmq-sys-defaults
@@ -27,7 +27,6 @@ LOG_BASE=${SYS_PREFIX}/var/log/rabbitmq
MNESIA_BASE=${SYS_PREFIX}/var/lib/rabbitmq/mnesia
ENABLED_PLUGINS_FILE=${SYS_PREFIX}/etc/rabbitmq/enabled_plugins
-OLD_CONF_ENV_FILE=/etc/rabbitmq/rabbitmq.conf
-CONF_ENV_FILE=${SYS_PREFIX}/etc/rabbitmq/rabbitmq-env.conf
-
PLUGINS_DIR="${RABBITMQ_HOME}/plugins"
+
+CONF_ENV_FILE=${SYS_PREFIX}/etc/rabbitmq/rabbitmq-env.conf