diff --git a/core/master_utils.c b/core/master_utils.c index 27753d561..61bc75f20 100644 --- a/core/master_utils.c +++ b/core/master_utils.c @@ -54,6 +54,12 @@ void uwsgi_destroy_processes() { uwsgi_detach_daemons(); + for (i = 1; i <= uwsgi.numproc; i++) { + if (uwsgi.workers[i].pid > 0) { + waitpid(uwsgi.workers[i].pid, &waitpid_status, 0); + } + } + for (i = 0; i < ushared->gateways_cnt; i++) { if (ushared->gateways[i].pid > 0) { kill(ushared->gateways[i].pid, SIGKILL);