diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-06-05 11:42:18 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-06-05 11:42:18 +0100 |
| commit | a7ba635108e67d213a516ac56fe755ac95477f09 (patch) | |
| tree | 06c8e6c2c64369f673caee2620f1c09d43bec8f7 /src | |
| parent | 660e907d23ec3c82415ccf08a3403803d7f4bc55 (diff) | |
| parent | f6361b51c99f9a48180d45d9b92ffd8512f0bf8d (diff) | |
| download | rabbitmq-server-git-a7ba635108e67d213a516ac56fe755ac95477f09.tar.gz | |
stable to default
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index c2d7e29d6b..29e38c1f5f 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -794,9 +794,25 @@ config_files() -> end, case init:get_argument(config) of {ok, Files} -> [Abs(File) || [File] <- Files]; - error -> case os:getenv("RABBITMQ_CONFIG_FILE") of - false -> []; - File -> [Abs(File) ++ " (not found)"] + error -> case config_setting() of + none -> []; + File -> [Abs(File) ++ " (not found)"] + end + end. + +%% This is a pain. We want to know where the config file is. But we +%% can't specify it on the command line if it is missing or the VM +%% will fail to start, so we need to find it by some mechanism other +%% than init:get_arguments/0. We can look at the environment variable +%% which is responsible for setting it... but that doesn't work for a +%% Windows service since the variable can change and the service not +%% be reinstalled, so in that case we add a magic application env. +config_setting() -> + case application:get_env(rabbit, windows_service_config) of + {ok, File1} -> File1; + undefined -> case os:getenv("RABBITMQ_CONFIG_FILE") of + false -> none; + File2 -> File2 end end. |
