X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver.cc;h=6ff6fc3a3a24a50a3377f8640d9d332783de529c;hb=3dcd41c50068eec906a1a11a178e9b3f08ef2326;hp=a57b44d5ca7f0dcecc48947b46793a127dcd86a0;hpb=9d08f9ec514ed7d6c00b61588dbfd1c4201d5c1b;p=m6w6%2Flibmemcached diff --git a/libtest/server.cc b/libtest/server.cc index a57b44d5..6ff6fc3a 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -190,6 +190,7 @@ bool Server::start() } size_t repeat= 5; + _app.slurp(); while (--repeat) { if (pid_file().empty() == false) @@ -203,15 +204,13 @@ bool Server::start() continue; } - throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Unable to open pidfile for: %s", - _running.c_str()); char buf[PATH_MAX]; getcwd(buf, sizeof(buf)); throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Unable to open pidfile in %s for: %s", + "Unable to open pidfile in %s for: %s stderr:%s", buf, - _running.c_str()); + _running.c_str(), + _app.stderr_c_str()); } } } @@ -244,20 +243,26 @@ bool Server::start() // If we happen to have a pid file, lets try to kill it if ((pid_file().empty() == false) and (access(pid_file().c_str(), R_OK) == 0)) { + _app.slurp(); if (kill_file(pid_file()) == false) { - throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Failed to kill off server after startup occurred, when pinging failed: %s", pid_file().c_str()); + throw libtest::fatal(LIBYATL_DEFAULT_PARAM, + "Failed to kill off server after startup occurred, when pinging failed: %s stderr:%s", + pid_file().c_str(), + _app.stderr_c_str()); } throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to ping(), waited: %u server started, having pid_file. exec: %s error:%s", - this_wait, _running.c_str(), _app.stderr_c_str()); + "Failed to ping(), waited: %u server started, having pid_file. exec: %s stderr:%s", + this_wait, _running.c_str(), + _app.stderr_c_str()); } else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to ping() server started. exec: %s", - _running.c_str()); + "Failed to ping() server started. exec: %s stderr:%s", + _running.c_str(), + _app.stderr_c_str()); } _running.clear(); return false;