summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-17 13:56:21 -0700
committerJeremy Allison <jra@samba.org>2009-06-17 13:56:21 -0700
commit7d20e8f7f4d3d1a17b3817cea370304f2f437809 (patch)
treed29e3e185c511bfdf7caa32c9d60aa3591746fbd /source3
parent57cd98de7214d31b1d491382a4ece99a90ac27dc (diff)
downloadsamba-7d20e8f7f4d3d1a17b3817cea370304f2f437809.tar.gz
samba-7d20e8f7f4d3d1a17b3817cea370304f2f437809.tar.bz2
samba-7d20e8f7f4d3d1a17b3817cea370304f2f437809.zip
Fix bug #6476 - more then 3000 smbd-zombies in memory
We weren't reaping children in the [x]inetd case. Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/server.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index a022f3e868..d3ce4b6f2d 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -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);