diff options
| author | Matthias Radestock <matthias@lshift.net> | 2010-04-30 15:24:52 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2010-04-30 15:24:52 +0100 |
| commit | c925bba84ec637b82f0180e9234d1e12c19fc364 (patch) | |
| tree | c62fa121d876a6e3e35d01e4cd94e8b42010c20b /src/rabbit.erl | |
| parent | 4eeddb1baa2972febb90af36e2a1f6a92b981b46 (diff) | |
| parent | 86ab54a9e59139a42f927ad3480d11e520dd7dd4 (diff) | |
| download | rabbitmq-server-git-c925bba84ec637b82f0180e9234d1e12c19fc364.tar.gz | |
merge default into bug22616
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index fe970675e0..225ff45042 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -235,14 +235,18 @@ rotate_logs(BinarySuffix) -> %%-------------------------------------------------------------------- start(normal, []) -> - {ok, SupPid} = rabbit_sup:start_link(), + case erts_version_check() of + ok -> + {ok, SupPid} = rabbit_sup:start_link(), - print_banner(), - [ok = run_boot_step(Step) || Step <- boot_steps()], - io:format("~nbroker running~n"), - - {ok, SupPid}. + print_banner(), + [ok = run_boot_step(Step) || Step <- boot_steps()], + io:format("~nbroker running~n"), + {ok, SupPid}; + Error -> + Error + end. stop(_State) -> terminated_ok = error_logger:delete_report_handler(rabbit_error_logger), @@ -255,6 +259,14 @@ stop(_State) -> %%--------------------------------------------------------------------------- +erts_version_check() -> + FoundVer = erlang:system_info(version), + case rabbit_misc:version_compare(?ERTS_MINIMUM, FoundVer, lte) of + true -> ok; + false -> {error, {erlang_version_too_old, + {found, FoundVer}, {required, ?ERTS_MINIMUM}}} + end. + boot_error(Format, Args) -> io:format("BOOT ERROR: " ++ Format, Args), error_logger:error_msg(Format, Args), @@ -404,8 +416,9 @@ print_banner() -> {"cookie hash", rabbit_misc:cookie_hash()}, {"log", log_location(kernel)}, {"sasl log", log_location(sasl)}, - {"database dir", rabbit_mnesia:dir()}], - DescrLen = lists:max([length(K) || {K, _V} <- Settings]), + {"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), io:nl(). |
