Add signal handler to avoid zombies in non-wait mode
@@ -1,3 +1,4 @@
+#include <signal.h>
#include <hooks/hooks.h>
#include "logger.h"
@@ -39,6 +40,11 @@ int load(LibraryHandle& handle) {
script_wait = wait->boolValue();
}
+ /* Install signal handler for non-wait case to avoid leaving zombie processes around */
+ if (!script_wait) {
+ signal(SIGCHLD, SIG_IGN);
+ }
+
return 0;