remove socket and pid files prior to waiting for kill.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-31 13:28:11 +01:00
parent a51de1cb0c
commit 798eb38eb0
+3 -2
View File
@@ -722,6 +722,9 @@ unsigned total = 10;
if (terminate != 0) { if (terminate != 0) {
mslog(s, NULL, LOG_DEBUG, "termination request received; waiting for children to die"); mslog(s, NULL, LOG_DEBUG, "termination request received; waiting for children to die");
kill_children(s); kill_children(s);
remove(s->socket_file);
remove_pid_file();
while (waitpid(-1, NULL, WNOHANG) == 0) { while (waitpid(-1, NULL, WNOHANG) == 0) {
if (total == 0) { if (total == 0) {
mslog(s, NULL, LOG_DEBUG, "not everyone died; forcing kill"); mslog(s, NULL, LOG_DEBUG, "not everyone died; forcing kill");
@@ -730,8 +733,6 @@ unsigned total = 10;
ms_sleep(500); ms_sleep(500);
total--; total--;
} }
remove(s->socket_file);
remove_pid_file();
/* try to clean-up everything allocated to ease checks /* try to clean-up everything allocated to ease checks
* for memory leaks. * for memory leaks.