summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-01-16 13:20:47 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2011-01-16 13:20:47 +0000
commit6d46c64c01af4dc48c9046b4a4ace4f301f1552a (patch)
tree9560d46b388ebd309fae54821e23aed3a69fceeb
parentc402e96e050192962e85c018c06844ed1670903e (diff)
downloadrabbitmq-server-6d46c64c01af4dc48c9046b4a4ace4f301f1552a.tar.gz
display config file locations on startup
-rwxr-xr-xscripts/rabbitmq-server2
-rw-r--r--src/rabbit.erl22
2 files changed, 22 insertions, 2 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server
index 4155b31d..be9b01a7 100755
--- a/scripts/rabbitmq-server
+++ b/scripts/rabbitmq-server
@@ -119,6 +119,8 @@ exec erl \
-sname ${RABBITMQ_NODENAME} \
-boot ${RABBITMQ_BOOT_FILE} \
${RABBITMQ_CONFIG_ARG} \
+ -config /tmp/foo.config \
+ -config bar \
+W w \
${RABBITMQ_SERVER_ERL_ARGS} \
${RABBITMQ_LISTEN_ARG} \
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 954e289b..b3620b81 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -373,6 +373,14 @@ home_dir() ->
Other -> Other
end.
+config_files() ->
+ case init:get_argument(config) of
+ {ok, Files} -> [filename:absname(
+ filename:rootname(File, ".config") ++ ".config") ||
+ File <- Files];
+ error -> []
+ end.
+
%---------------------------------------------------------------------------
print_banner() ->
@@ -398,14 +406,24 @@ print_banner() ->
Settings = [{"node", node()},
{"app descriptor", app_location()},
{"home dir", home_dir()},
+ {"config file(s)", config_files()},
{"cookie hash", rabbit_misc:cookie_hash()},
{"log", log_location(kernel)},
{"sasl log", log_location(sasl)},
{"database dir", rabbit_mnesia:dir()},
{"erlang version", erlang:system_info(version)}],
DescrLen = 1 + lists:max([length(K) || {K, _V} <- Settings]),
- Format = "~-" ++ integer_to_list(DescrLen) ++ "s: ~s~n",
- lists:foreach(fun ({K, V}) -> io:format(Format, [K, V]) end, Settings),
+ Format = fun (K, V) ->
+ io:format("~-" ++ integer_to_list(DescrLen) ++ "s: ~s~n",
+ [K, V])
+ end,
+ lists:foreach(fun ({"config file(s)" = K, []}) ->
+ Format(K, "");
+ ({"config file(s)" = K, [V0 | Vs]}) ->
+ Format(K, V0), [Format("", V) || V <- Vs];
+ ({K, V}) ->
+ Format(K, V)
+ end, Settings),
io:nl().
ensure_working_log_handlers() ->