nghttpx: Show textual signal description when worker process exited
This commit is contained in:
parent
e77f9d95d3
commit
2be6a94d70
19
src/shrpx.cc
19
src/shrpx.cc
|
@ -370,11 +370,26 @@ void signal_cb(struct ev_loop *loop, ev_signal *w, int revents) {
|
|||
|
||||
namespace {
|
||||
void worker_process_child_cb(struct ev_loop *loop, ev_child *w, int revents) {
|
||||
std::string signalstr;
|
||||
if (WIFSIGNALED(w->rstatus)) {
|
||||
signalstr += ";signal ";
|
||||
auto sig = WTERMSIG(w->rstatus);
|
||||
auto s = strsignal(sig);
|
||||
if (s) {
|
||||
signalstr += s;
|
||||
signalstr += "(";
|
||||
} else {
|
||||
signalstr += "UNKNOWN(";
|
||||
}
|
||||
signalstr += util::utos(sig);
|
||||
signalstr += ")";
|
||||
}
|
||||
|
||||
LOG(NOTICE) << "Worker process (" << w->rpid << ") exited "
|
||||
<< (WIFEXITED(w->rstatus) ? "normally" : "abnormally")
|
||||
<< " with status " << std::hex << w->rstatus << std::oct
|
||||
<< "; exit status " << WEXITSTATUS(w->rstatus) << "; signal "
|
||||
<< (WIFSIGNALED(w->rstatus) ? WTERMSIG(w->rstatus) : 0);
|
||||
<< "; exit status " << WEXITSTATUS(w->rstatus)
|
||||
<< (signalstr.empty() ? "" : signalstr.c_str());
|
||||
|
||||
ev_break(loop);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue