diff options
| author | Dan Engelbrecht <[email protected]> | 2024-04-18 17:48:45 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-04-18 17:48:45 +0200 |
| commit | f84af894f6c751e3643647229ae2e95d54c0ea31 (patch) | |
| tree | 5b9c1554e276f455785cf0626881ca789816f975 /src/zen/cmds/up_cmd.cpp | |
| parent | safer oplog import (#52) (diff) | |
| download | archived-zen-f84af894f6c751e3643647229ae2e95d54c0ea31.tar.xz archived-zen-f84af894f6c751e3643647229ae2e95d54c0ea31.zip | |
capture zenserver output on error (#51)
* capture spawned server output and output on launch error
* fix logging and launch validation in tests
Diffstat (limited to 'src/zen/cmds/up_cmd.cpp')
| -rw-r--r-- | src/zen/cmds/up_cmd.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/zen/cmds/up_cmd.cpp b/src/zen/cmds/up_cmd.cpp index 3095211b6..0db5afb3b 100644 --- a/src/zen/cmds/up_cmd.cpp +++ b/src/zen/cmds/up_cmd.cpp @@ -86,14 +86,20 @@ UpCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (!Server.WaitUntilReady(Timeout)) { - ZEN_ERROR("zen server launch failed (timed out)"); - return 1; + if (Server.IsRunning()) + { + ZEN_ERROR("zen server launch failed (timed out), terminating"); + Server.Terminate(); + return 111; + } + int ReturnCode = Server.Shutdown(); + ZEN_CONSOLE("{}", Server.GetLogOutput()); + return ReturnCode; } else { ZEN_CONSOLE("zen server up"); } - return 0; } |