diff options
author | Hubert Plociniczak <hubert@lshift.net> | 2009-02-04 04:12:17 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert@lshift.net> | 2009-02-04 04:12:17 +0000 |
commit | 817f7532d622d4d0a8a7087c4f9e8f98869b88e4 (patch) | |
tree | 3f6bd5a73ee8faa47a50991001845876426bc20c | |
parent | ce3787ff42a492406b681c52eddc89e588f1111d (diff) | |
download | rabbitmq-server-817f7532d622d4d0a8a7087c4f9e8f98869b88e4.tar.gz |
Moved main configuration from /etc/default/rabbitmq to /etc/rabbitmq/rabbitmq.conf. Updated man pages to reflect the changes. To avoid overwriting the variables those in /etc/default/rabbitmq need to be prefix with INITD_. Added checks in scripts to handle those cases. rpm and debian need to handle /etc/rabbitmq directory.
-rw-r--r-- | docs/rabbitmq-multi.1.pod | 2 | ||||
-rw-r--r-- | docs/rabbitmq-server.1.pod | 4 | ||||
-rw-r--r-- | docs/rabbitmq.5.pod | 43 | ||||
-rw-r--r-- | packaging/RPMS/Fedora/rabbitmq-server.spec | 4 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/dirs | 1 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/postinst | 1 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/postrm | 3 | ||||
-rwxr-xr-x | scripts/rabbitmq-multi | 9 | ||||
-rwxr-xr-x | scripts/rabbitmq-server | 13 |
9 files changed, 58 insertions, 22 deletions
diff --git a/docs/rabbitmq-multi.1.pod b/docs/rabbitmq-multi.1.pod index 82c39116..9a7b683e 100644 --- a/docs/rabbitmq-multi.1.pod +++ b/docs/rabbitmq-multi.1.pod @@ -40,7 +40,7 @@ Start 3 local RabbitMQ nodes with unique, sequential port numbers: =head1 SEE ALSO -rabbitmq-server(1), rabbitmqctl(1) +rabbitmq(5), rabbitmq-server(1), rabbitmqctl(1) =head1 AUTHOR diff --git a/docs/rabbitmq-server.1.pod b/docs/rabbitmq-server.1.pod index 00210c8b..5f13f37b 100644 --- a/docs/rabbitmq-server.1.pod +++ b/docs/rabbitmq-server.1.pod @@ -44,7 +44,7 @@ B<RABBITMQ_NODE_PORT> Defaults to 5672. B<RABBITMQ_CLUSTER_CONFIG_FILE> - Defaults to /etc/default/rabbitmq_cluster.config. If this file is + Defaults to /etc/rabbitmq/rabbitmq_cluster.config. If this file is present it is used by the server to auto-configure a RabbitMQ cluster. See the clustering guide at http://www.rabbitmq.com/clustering.html @@ -62,7 +62,7 @@ Run RabbitMQ AMQP server in the background: =head1 SEE ALSO -rabbitmq-multi(1), rabbitmqctl(1) +rabbitmq(5), rabbitmq-multi(1), rabbitmqctl(1) =head1 AUTHOR diff --git a/docs/rabbitmq.5.pod b/docs/rabbitmq.5.pod index e6972935..95416ebf 100644 --- a/docs/rabbitmq.5.pod +++ b/docs/rabbitmq.5.pod @@ -1,10 +1,10 @@ =head1 NAME -/etc/default/rabbitmq - default settings for RabbitMQ AMQP server +/etc/rabbitmq/rabbitmq.conf - default settings for RabbitMQ AMQP server =head1 DESCRIPTION -/etc/default/rabbitmq contains variable settings that override the +/etc/rabbitmq/rabbitmq.conf contains variable settings that override the defaults built in to the RabbitMQ startup scripts. The file is interpreted by the system shell, and so should consist of @@ -13,29 +13,40 @@ syntax is permitted (since the file is sourced using the shell "." operator), including line comments starting with "#". In order of preference, the startup scripts get their values from the -environment, from /etc/default/rabbitmq, and finally from the built-in -default values. For example, for the B<RABBITMQ_NODENAME> setting, +environment, from /etc/default/rabbitmq (if starting through the standard +init.d script), from /etc/rabbitmq/rabbitmq.conf and finally from the +built-in default values. For example, for the B<RABBITMQ_NODENAME> setting, B<RABBITMQ_NODENAME> - from the environment is checked first. If it is absent or equal - to the empty string, then + from the environment is checked first. If it is absent or equal to the + empty string, then + +B<INITD_NODENAME> + from /etc/default/rabbitmq is checked next, only if the server is + started through the standard init.d script. If it is also absent or set + equal to the empty string, then B<NODENAME> - from /etc/default/rabbitmq is checked next. If it is also absent - or set equal to the empty string, then the default value from the - startup script is used. + from /etc/rabbitmq/rabbitmq.conf is checked. If that is also absent or + set equal to the empty string then the default value from the startup + script is used. + +The variable names in /etc/rabbitmq/rabbitmq.conf are always equal to the +environment variable names, with the B<RABBITMQ_> prefix removed. +Similarly, variable names in /etc/default/rabbitmq (loaded only when +starting through the init.d script) are always equal to the environmental +variable names, with the B<RABBITMQ_> prefix substituted by B<INITD_>: -The variable names in /etc/default/rabbitmq are always equal to the -environment variable names, with the B<RABBITMQ_> prefix removed: -B<RABBITMQ_NODE_PORT> from the environment becomes B<NODE_PORT> in the -/etc/default/rabbitmq file, etc. +B<RABBITMQ_NODE_PORT> from the environment becomes B<INITD_NODE_PORT> in +the /etc/default/rabbitmq and B<NODE_PORT> in the +/etc/rabbitmq/rabbitmq.conf file, etc. =head1 EXAMPLES -The following is an example of a complete /etc/default/rabbitmq file +The following is an example of a complete /etc/rabbitmq/rabbitmq.conf file that overrides the default Erlang node name from "rabbit" to "hare": - # I am a complete /etc/default/rabbitmq file. + # I am a complete /etc/rabbitmq/rabbitmq.conf file. # Comment lines start with a hash character. # This is a /bin/sh script file - use ordinary envt var syntax NODENAME=hare @@ -46,7 +57,7 @@ rabbitmq-server(1), rabbitmq-multi(1), rabbitmqctl(1) =head1 AUTHOR -Originally written by The RabbitMQ Team <info@lshift.net> +Originally written by The RabbitMQ Team <info@rabbitmq.com> =head1 COPYRIGHT diff --git a/packaging/RPMS/Fedora/rabbitmq-server.spec b/packaging/RPMS/Fedora/rabbitmq-server.spec index fc109bdb..813171d6 100644 --- a/packaging/RPMS/Fedora/rabbitmq-server.spec +++ b/packaging/RPMS/Fedora/rabbitmq-server.spec @@ -66,6 +66,8 @@ sed -i 's|/usr/lib/|%{_libdir}/|' %{buildroot}%{_sbindir}/rabbitmqctl mkdir -p %{buildroot}/etc/logrotate.d install -m 0644 %SOURCE3 %{buildroot}/etc/logrotate.d/rabbitmq-server +mkdir -p %{buildroot}/etc/rabbitmq + rm %{_maindir}/LICENSE %{_maindir}/LICENSE-MPL-RabbitMQ %{_maindir}/INSTALL #Build the list of files @@ -90,6 +92,7 @@ fi chown -R rabbitmq:rabbitmq /var/lib/rabbitmq chown -R rabbitmq:rabbitmq /var/log/rabbitmq +chown -R rabbitmq:rabbitmq /etc/rabbitmq /sbin/chkconfig --add %{name} /sbin/service rabbitmq-server start @@ -108,6 +111,7 @@ fi %defattr(-,root,root,-) %dir /var/lib/rabbitmq %dir /var/log/rabbitmq +%dir /etc/rabbitmq %{_rabbit_erllibdir} %{_rabbit_libdir} %{_initrddir}/rabbitmq-server diff --git a/packaging/debs/Debian/debian/dirs b/packaging/debs/Debian/debian/dirs index 1a707bc1..625b7d41 100644 --- a/packaging/debs/Debian/debian/dirs +++ b/packaging/debs/Debian/debian/dirs @@ -5,4 +5,5 @@ usr/share/man var/lib/rabbitmq/mnesia var/log/rabbitmq etc/logrotate.d +etc/rabbitmq diff --git a/packaging/debs/Debian/debian/postinst b/packaging/debs/Debian/debian/postinst index 05fb179c..21d14170 100644 --- a/packaging/debs/Debian/debian/postinst +++ b/packaging/debs/Debian/debian/postinst @@ -31,6 +31,7 @@ fi chown -R rabbitmq:rabbitmq /var/lib/rabbitmq chown -R rabbitmq:rabbitmq /var/log/rabbitmq +chown -R rabbitmq:rabbitmq /etc/rabbitmq case "$1" in configure) diff --git a/packaging/debs/Debian/debian/postrm b/packaging/debs/Debian/debian/postrm index 8d1e92a9..a999d95b 100644 --- a/packaging/debs/Debian/debian/postrm +++ b/packaging/debs/Debian/debian/postrm @@ -31,6 +31,9 @@ case "$1" in if [ -d /var/run/rabbitmq ]; then rm -r /var/run/rabbitmq fi + if [ -d /etc/rabbitmq ]; then + rm -r /etc/rabbitmq + fi if getent passwd rabbitmq >/dev/null; then deluser rabbitmq fi diff --git a/scripts/rabbitmq-multi b/scripts/rabbitmq-multi index 84985e90..b099a999 100755 --- a/scripts/rabbitmq-multi +++ b/scripts/rabbitmq-multi @@ -30,20 +30,27 @@ ## Contributor(s): ______________________________________. ## -[ -f /etc/default/rabbitmq ] && . /etc/default/rabbitmq +[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf +[ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${INITD_NODENAME} [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME} [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=rabbit +[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${INITD_NODE_IP_ADDRESS} [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS} [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=0.0.0.0 +[ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${INITD_NODE_PORT} [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${NODE_PORT} [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=5672 +[ "x" = "x$RABBITMQ_SCRIPT_HOME" ] && RABBITMQ_SCRIPT_HOME=${INITD_SCRIPT_HOME} [ "x" = "x$RABBITMQ_SCRIPT_HOME" ] && RABBITMQ_SCRIPT_HOME=${SCRIPT_HOME} [ "x" = "x$RABBITMQ_SCRIPT_HOME" ] && RABBITMQ_SCRIPT_HOME=$(dirname $0) +[ "x" = "x$RABBITMQ_PIDS_FILE" ] && RABBITMQ_PIDS_FILE=${INITD_PIDS_FILE} [ "x" = "x$RABBITMQ_PIDS_FILE" ] && RABBITMQ_PIDS_FILE=${PIDS_FILE} [ "x" = "x$RABBITMQ_PIDS_FILE" ] && RABBITMQ_PIDS_FILE=/var/lib/rabbitmq/pids +[ "x" = "x$RABBITMQ_MULTI_ERL_ARGS" ] && RABBITMQ_MULTI_ERL_ARGS=${INITD_MULTI_ERL_ARGS} [ "x" = "x$RABBITMQ_MULTI_ERL_ARGS" ] && RABBITMQ_MULTI_ERL_ARGS=${MULTI_ERL_ARGS} [ "x" = "x$RABBITMQ_MULTI_ERL_ARGS" ] && RABBITMQ_MULTI_ERL_ARGS= +[ "x" = "x$RABBITMQ_MULTI_START_ARGS" ] && RABBITMQ_MULTI_START_ARGS=${INITD_MULTI_START_ARGS} [ "x" = "x$RABBITMQ_MULTI_START_ARGS" ] && RABBITMQ_MULTI_START_ARGS=${MULTI_START_ARGS} [ "x" = "x$RABBITMQ_MULTI_START_ARGS" ] && RABBITMQ_MULTI_START_ARGS= diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 572262c9..88b9f33a 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -30,7 +30,7 @@ ## Contributor(s): ______________________________________. ## -[ -f /etc/default/rabbitmq ] && . /etc/default/rabbitmq +[ -f /etc/rabbitmq/rabbitmq.conf ] && . /etc/rabbitmq/rabbitmq.conf [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME} [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=rabbit @@ -38,26 +38,35 @@ [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=0.0.0.0 [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${NODE_PORT} [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=5672 +[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${INITD_SERVER_ERL_ARGS} [ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS} [ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS="+K true +A30 \ -kernel inet_default_listen_options [{nodelay,true},{sndbuf,16384},{recbuf,4096}] \ -kernel inet_default_connect_options [{nodelay,true}]" +[ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=${INITD_CLUSTER_CONFIG_FILE} [ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=${CLUSTER_CONFIG_FILE} -[ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=/etc/default/rabbitmq_cluster.config +[ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=/etc/rabbitmq/rabbitmq_cluster.config +[ "x" = "x$RABBITMQ_LOG_BASE" ] && RABBITMQ_LOG_BASE=${INITD_LOG_BASE} [ "x" = "x$RABBITMQ_LOG_BASE" ] && RABBITMQ_LOG_BASE=${LOG_BASE} [ "x" = "x$RABBITMQ_LOG_BASE" ] && RABBITMQ_LOG_BASE=/var/log/rabbitmq +[ "x" = "x$RABBITMQ_MNESIA_BASE" ] && RABBITMQ_MNESIA_BASE=${INITD_MNESIA_BASE} [ "x" = "x$RABBITMQ_MNESIA_BASE" ] && RABBITMQ_MNESIA_BASE=${MNESIA_BASE} [ "x" = "x$RABBITMQ_MNESIA_BASE" ] && RABBITMQ_MNESIA_BASE=/var/lib/rabbitmq/mnesia +[ "x" = "x$RABBITMQ_MNESIA_DIR" ] && RABBITMQ_MNESIA_DIR=${INITD_MNESIA_DIR} [ "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_SERVER_START_ARGS" ] && RABBITMQ_SERVER_START_ARGS=${INITD_SERVER_START_ARGS} [ "x" = "x$RABBITMQ_SERVER_START_ARGS" ] && RABBITMQ_SERVER_START_ARGS=${SERVER_START_ARGS} [ "x" = "x$RABBITMQ_SERVER_START_ARGS" ] && RABBITMQ_SERVER_START_ARGS= ## Log rotation +[ "x" = "x$RABBITMQ_LOGS" ] && RABBITMQ_LOGS=${INITD_LOGS} [ "x" = "x$RABBITMQ_LOGS" ] && RABBITMQ_LOGS=${LOGS} [ "x" = "x$RABBITMQ_LOGS" ] && RABBITMQ_LOGS="${RABBITMQ_LOG_BASE}/${RABBITMQ_NODENAME}.log" +[ "x" = "x$RABBITMQ_SASL_LOGS" ] && RABBITMQ_SASL_LOGS=${INITD_SASL_LOGS} [ "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" +[ "x" = "x$RABBITMQ_BACKUP_EXTENSION" ] && RABBITMQ_BACKUP_EXTENSION=${INITD_BACKUP_EXTENSION} [ "x" = "x$RABBITMQ_BACKUP_EXTENSION" ] && RABBITMQ_BACKUP_EXTENSION=${BACKUP_EXTENSION} [ "x" = "x$RABBITMQ_BACKUP_EXTENSION" ] && RABBITMQ_BACKUP_EXTENSION=".1" |