Fix bug #6476 - more then 3000 smbd-zombies in memory
authorJeremy Allison <jra@samba.org>
Wed, 17 Jun 2009 20:56:21 +0000 (13:56 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 17 Jun 2009 20:56:21 +0000 (13:56 -0700)
We weren't reaping children in the [x]inetd case.
Jeremy.

source3/smbd/server.c

index a022f3e8683fc38d112fcbbc295a205444e28e22..d3ce4b6f2d7b0162e10025df2cc6c281247f0e23 100644 (file)
@@ -1055,6 +1055,11 @@ extern void build_options(bool screen);
        BlockSignals(False, SIGUSR1);
        BlockSignals(False, SIGTERM);
 
+       /* Ensure we leave no zombies until we
+        * correctly set up child handling below. */
+
+       CatchChild();
+
        /* we want total control over the permissions on created files,
           so set our umask to 0 */
        umask(0);
@@ -1221,6 +1226,13 @@ extern void build_options(bool screen);
                /* close our standard file descriptors */
                close_low_fds(False); /* Don't close stderr */
 
+#ifdef HAVE_ATEXIT
+               atexit(killkids);
+#endif
+
+               /* Stop zombies */
+               smbd_setup_sig_chld_handler();
+
                smbd_process();
 
                exit_server_cleanly(NULL);