569 |
569 |
570 handler->debug_finished = TRUE; |
570 handler->debug_finished = TRUE; |
571 |
571 |
572 if(handler->result == REQ_ABORTED && handler->process.pid != 0) { |
572 if(handler->result == REQ_ABORTED && handler->process.pid != 0) { |
573 log_ereport(LOG_FAILURE, "cgi-send: kill script: %s pid: %d", handler->path, (int)handler->process.pid); |
573 log_ereport(LOG_FAILURE, "cgi-send: kill script: %s pid: %d", handler->path, (int)handler->process.pid); |
574 if(killpg(handler->process.pid, SIGKILL)) { |
574 if(kill(handler->process.pid, SIGTERM)) { |
575 log_ereport(LOG_FAILURE, "cgi-send: pid: %d kill failed: %s", (int)handler->process.pid, strerror(errno)); |
575 log_ereport(LOG_FAILURE, "cgi-send: pid: %d kill failed: %s", (int)handler->process.pid, strerror(errno)); |
576 // test: does kill work? |
576 } else { |
577 if(kill(handler->process.pid, SIGKILL)) { |
577 log_ereport(LOG_DEBUG, "cgi-send: finish: req: %p kill %d successful", rq, (int)handler->process.pid); |
578 log_ereport(LOG_FAILURE, "cgi-send: pid %d kill2 failed: %s", (int)handler->process.pid, strerror(errno)); |
|
579 } else { |
|
580 log_ereport(LOG_DEBUG, "cgi-send: kill(%d, SIGKILL): success", (int)handler->process.pid); |
|
581 } |
|
582 } |
578 } |
583 } |
579 } |
584 |
580 |
585 if(--handler->events > 0) { |
581 if(--handler->events > 0) { |
586 return 0; |
582 return 0; |