SystemExec try SIGINT before SIGKILL

Even though SIGINT is intended to be sent from terminals only,
it is more successful at terminating various child processes than
closing stdin and sending SIGTERM.
This commit is contained in:
Robin Gareus 2022-09-12 16:17:55 +02:00
parent f85b4fef15
commit 18474d89f8
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -682,6 +682,13 @@ SystemExec::terminate ()
wait(WNOHANG);
}
if (pid) {
::kill(pid, SIGINT);
::usleep(250000);
sched_yield();
wait(WNOHANG);
}
/* if pid is non-zero, the child task is STILL executing after being
* sent SIGTERM. Act tough ... send SIGKILL
*/