diff options
author | Matthew Sackman <matthew@lshift.net> | 2009-11-24 17:49:37 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@lshift.net> | 2009-11-24 17:49:37 +0000 |
commit | 583b1441fdc758d5c7a71c39a5baf74ed81a4f3d (patch) | |
tree | 6f6511eccf358dc96519efead6cb539264df0993 /scripts/rabbitmq-server | |
parent | 446cb6f8013300284ba8aba85016b5ac1ae92c51 (diff) | |
download | rabbitmq-server-583b1441fdc758d5c7a71c39a5baf74ed81a4f3d.tar.gz |
Reintroduced traces of tcp_listeners where it turns out to be a jolly good idea, but don't set either one unless the other has been set. Thus if neither has been set then we don't do nowt.
Diffstat (limited to 'scripts/rabbitmq-server')
-rwxr-xr-x | scripts/rabbitmq-server | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 693b0f52..8ba7d6b8 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -31,6 +31,8 @@ ## NODENAME=rabbit +NODE_IP_ADDRESS=0.0.0.0 +NODE_PORT=5672 SERVER_ERL_ARGS="+K true +A30 \ -kernel inet_default_listen_options [{nodelay,true},{sndbuf,16384},{recbuf,4096}] \ -kernel inet_default_connect_options [{nodelay,true}]" @@ -42,6 +44,17 @@ SERVER_START_ARGS= . `dirname $0`/rabbitmq-env + +if [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] +then + if [ "x" != "x$RABBITMQ_NODE_PORT" ] + then RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS} + fi +else + if [ "x" = "x$RABBITMQ_NODE_PORT" ] + then RABBITMQ_NODE_PORT=${NODE_PORT} + fi +fi [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME} [ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS} [ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=${CLUSTER_CONFIG_FILE} @@ -85,6 +98,9 @@ fi RABBITMQ_CONFIG_ARG= [ -f "${RABBITMQ_CONFIG_FILE}.config" ] && RABBITMQ_CONFIG_ARG="-config ${RABBITMQ_CONFIG_FILE}" +RABBITMQ_LISTEN_ARG= +[ "x" != "x$RABBITMQ_NODE_PORT" ] && [ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_LISTEN_ARG="-rabbit tcp_listeners '[{"'${RABBITMQ_NODE_IP_ADDRESS}'", '${RABBITMQ_NODE_PORT}'}]'" + # we need to turn off path expansion because some of the vars, notably # RABBITMQ_SERVER_ERL_ARGS, contain terms that look like globs and # there is no other way of preventing their expansion. @@ -98,6 +114,7 @@ exec erl \ ${RABBITMQ_CONFIG_ARG} \ +W w \ ${RABBITMQ_SERVER_ERL_ARGS} \ + ${RABBITMQ_LISTEN_ARG} \ -sasl errlog_type error \ -kernel error_logger '{file,"'${RABBITMQ_LOGS}'"}' \ -sasl sasl_error_logger '{file,"'${RABBITMQ_SASL_LOGS}'"}' \ |