rabbitmq_peer_discovery_consul: Log output from Consul daemon
[Why] It helps diagnose any startup issues. Typically a problem with the configuration where the log file is not yet created.
This commit is contained in:
parent
f4d61d2775
commit
b03f0bd07d
|
|
@ -202,9 +202,19 @@ start_consul(Config) ->
|
|||
Cmd = [ConsulBin, "agent",
|
||||
"-config-dir", ConsulConfDir,
|
||||
"-log-file", LogFile],
|
||||
ConsulPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end),
|
||||
ConsulPid = spawn(fun() -> do_start_consul(Cmd) end),
|
||||
rabbit_ct_helpers:set_config(Config, {consul_pid, ConsulPid}).
|
||||
|
||||
do_start_consul(Cmd) ->
|
||||
case rabbit_ct_helpers:exec(Cmd) of
|
||||
{ok, Stdout} ->
|
||||
ct:pal("Consul daemon exited:~n~s", [Stdout]);
|
||||
{error, Reason, Stdout} ->
|
||||
ct:pal(
|
||||
"Consul daemon exited with error ~0p:~n~s",
|
||||
[Reason, Stdout])
|
||||
end.
|
||||
|
||||
stop_consul(Config) ->
|
||||
case rabbit_ct_helpers:get_config(Config, consul_pid) of
|
||||
ConsulPid when is_pid(ConsulPid) ->
|
||||
|
|
|
|||
Loading…
Reference in New Issue