changeset 9817:32ca8e40f33a

6805959 peruser nscd doesn't reap child processes after these exited, such child processes remain as zombies
author Sreedhar Chalamalasetti - Sun Microsystems - Bangalore India <Sreedhar.Chalamalasetti@Sun.COM>
date Tue, 09 Jun 2009 00:32:33 +0530
parents 847676ec1c5b
children 814f951ec644
files usr/src/cmd/nscd/server.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/nscd/server.c	Mon Jun 08 10:35:50 2009 -0700
+++ b/usr/src/cmd/nscd/server.c	Tue Jun 09 00:32:33 2009 +0530
@@ -19,12 +19,10 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * Simple doors name server cache daemon
  */
@@ -39,6 +37,7 @@
 #include <sys/stat.h>
 #include <tsol/label.h>
 #include <zone.h>
+#include <signal.h>
 #include "cache.h"
 #include "nscd_log.h"
 #include "nscd_selfcred.h"
@@ -436,6 +435,13 @@
 			detachfromtty();
 		}
 	} else { /* NSCD_FORKER */
+		/*
+		 * To avoid PUN (Per User Nscd) processes from becoming
+		 * zombies after they exit, the forking nscd should
+		 * ignore the SIGCLD signal so that it does not
+		 * need to wait for every child PUN to exit.
+		 */
+		(void) signal(SIGCLD, SIG_IGN);
 		(void) open("/dev/null", O_RDWR, 0);
 		(void) dup(0);
 		if (_logfd != 2)