From nobody@FreeBSD.org  Thu Jan 19 00:20:52 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8458016A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 19 Jan 2006 00:20:52 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4B1A443D45
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 19 Jan 2006 00:20:52 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k0J0KqeQ075600
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 19 Jan 2006 00:20:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k0J0KqfB075599;
	Thu, 19 Jan 2006 00:20:52 GMT
	(envelope-from nobody)
Message-Id: <200601190020.k0J0KqfB075599@www.freebsd.org>
Date: Thu, 19 Jan 2006 00:20:52 GMT
From: Arjan van der Velde <dj_noresult@hotmail.com>
Reply-To: Arjan van der Velde <dj_noresult@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /usr/sbin/rpc.yppasswdd leaves zombie sh processes
X-Send-Pr-Version: www-2.3

>Number:         91980
>Category:       bin
>Synopsis:       [nis] yppasswdd(1) leaves zombie sh processes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 19 00:30:07 GMT 2006
>Closed-Date:    Mon Jan 05 13:06:18 UTC 2009
>Last-Modified:  Mon Jan  5 13:10:00 UTC 2009
>Originator:     Arjan van der Velde
>Release:        6.0-RELEASE-p2 on i386
>Organization:
Mohja
>Environment:
FreeBSD prime 6.0-RELEASE-p2 FreeBSD 6.0-RELEASE-p2 #0: Thu Jan 12 13:38:48 CET 2006     root@prime:/usr/obj/usr/src/sys/noresult-prime-0.2  i386

>Description:
Whenever changing a password the rpc.yppasswdd updates the password correctly,
but leaves a process "[sh]" in zombie state. See below.

prime# ps -axj | grep "rpc\.yppasswdd"
root      4437     1  4437  4437    0 Is    ??    0:00.01 /usr/sbin/rpc.yppasswdd -v
prime# ps -axj | grep 4437
root      4437     1  4437  4437    0 Is    ??    0:00.01 /usr/sbin/rpc.yppasswdd -v
root      4440  4437  4437  4437    0 RE    ??    0:00.26 [sh]
root      5042  3826  5041  3796    2 S+    p1    0:00.00 grep 4437
prime#

The sh process cannot be killed. The only solution is to restart
rpc.yppasswdd. I'm not sure what the impact of those zombie processes is
and as a workaround one could do a periodical restart of the rpc.yppasswdd
process.

Thanks,

Regards,

Arjan van der Velde

>How-To-Repeat:
Setup a NIS server and start the rpc.yppasswdd process by turning on the
following options in rc.conf:

nisdomainname="nis-domain"
nis_server_enable="YES"
nis_yppasswdd_enable="YES"
nis_client_enable="YES"
nis_client_flags="-S nis-domain,192.168.10.15"
nis_yppasswdd_flags="-v"

in /var/yp there is a master.passwd present containing a selection of user
to be served using NIS. The initial NIS maps have been created following the
handbook.
>Fix:
Workaround: restart the rpc.yppasswdd process periodically.

>Release-Note:
>Audit-Trail:

From: "Jui-Nan Lin" <jnlin@csie.nctu.edu.tw>
To: bug-followup@freebsd.org, dj_noresult@hotmail.com
Cc:  
Subject: Re: bin/91980: yppasswdd(1) leaves zombie sh processes
Date: Wed, 29 Oct 2008 00:45:23 +0800

 ------=_Part_69382_23502460.1225212323749
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Attached is my patch. You can also download the patch via:
 http://www.cs.nctu.edu.tw/~jnlin/yppasswdd_main.c.patch
 
 ------=_Part_69382_23502460.1225212323749
 Content-Type: text/x-diff; name=yppasswdd_main.c.patch
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_fmurqgun0
 Content-Disposition: attachment; filename=yppasswdd_main.c.patch
 
 LS0tIC91c3Ivc3JjL3Vzci5zYmluL3JwYy55cHBhc3N3ZGQveXBwYXNzd2RkX21haW4uYwkyMDA1
 LTA1LTAyIDIyOjAyOjQzLjAwMDAwMDAwMCArMDgwMAorKysgeXBwYXNzd2RkX21haW4uYwkyMDA4
 LTEwLTI5IDAwOjMyOjUyLjYzODMwMTQyOCArMDgwMApAQCAtMTY1LDYgKzE2NSw3IEBACiAJc3Ry
 dWN0IHNvY2thZGRyX2luIHNhZGRyOwogCXNvY2tsZW5fdCBhc2l6ZSA9IHNpemVvZiAoc2FkZHIp
 OwogCXN0cnVjdCBuZXRjb25maWcgKm5jb25mOworCXN0cnVjdCBzaWdhY3Rpb24gc2E7CiAJdm9p
 ZCAqbG9jYWxoYW5kbGU7CiAJaW50IGNoOwogCWNoYXIgKm1hc3Rlcm5hbWU7CkBAIC0yNjgsNiAr
 MjY5LDkgQEAKIAkJfQogCX0KIAlvcGVubG9nKCJycGMueXBwYXNzd2RkIiwgTE9HX1BJRCwgTE9H
 X0RBRU1PTik7CisJbWVtc2V0KCZzYSwgMCwgc2l6ZW9mKHNhKSk7CisJc2Euc2FfZmxhZ3MgPSBT
 QV9OT0NMRFdBSVQ7CisJc2lnYWN0aW9uKFNJR0NITEQsICZzYSwgTlVMTCk7CiAKIAlycGNiX3Vu
 c2V0KFlQUEFTU1dEUFJPRywgWVBQQVNTV0RWRVJTLCBOVUxMKTsKIAlycGNiX3Vuc2V0KE1BU1RF
 Ul9ZUFBBU1NXRFBST0csIE1BU1RFUl9ZUFBBU1NXRFZFUlMsIE5VTEwpOwo=
 ------=_Part_69382_23502460.1225212323749--
Responsible-Changed-From-To: freebsd-bugs->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Wed Oct 29 01:55:26 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91980 
State-Changed-From-To: open->patched 
State-Changed-By: rafan 
State-Changed-When: Thu Oct 30 01:54:42 UTC 2008 
State-Changed-Why:  
Fix in HEAD. Will MFC after 1 month to 6.4-STABLE and 7.1-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91980 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/91980: commit references a PR
Date: Mon,  5 Jan 2009 04:26:44 +0000 (UTC)

 Author: rafan
 Date: Mon Jan  5 04:26:24 2009
 New Revision: 186756
 URL: http://svn.freebsd.org/changeset/base/186756
 
 Log:
   MFC r184459
   
    - Whenever a password/shell is changed via rpc.yppasswdd, the daemon leaves
      one zombie process because it does not do the cleanup. For a long running
      NIS/YP server, it will have lots of zombie processes on it. Fix that by
      ignoring the SIGCHLD signal since we don't really care about the exit
      status in this case.
   
   PR:           bin/91980
   Reported by:  Arjan van der Velde <dj_noresult at hotmail.com>
   Submitted by: Jui-Nan Lin" <jnlin at csie.nctu.edu.tw>
   Reviewed by:  delphij
 
 Modified:
   stable/7/usr.sbin/rpc.yppasswdd/   (props changed)
   stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
 
 Modified: stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
 ==============================================================================
 --- stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c	Mon Jan  5 03:50:04 2009	(r186755)
 +++ stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_main.c	Mon Jan  5 04:26:24 2009	(r186756)
 @@ -165,6 +165,7 @@ main(int argc, char *argv[])
  	struct sockaddr_in saddr;
  	socklen_t asize = sizeof (saddr);
  	struct netconfig *nconf;
 +	struct sigaction sa;
  	void *localhandle;
  	int ch;
  	char *mastername;
 @@ -268,6 +269,9 @@ the %s domain -- aborting", yppasswd_dom
  		}
  	}
  	openlog("rpc.yppasswdd", LOG_PID, LOG_DAEMON);
 +	memset(&sa, 0, sizeof(sa));
 +	sa.sa_flags = SA_NOCLDWAIT;
 +	sigaction(SIGCHLD, &sa, NULL);
  
  	rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL);
  	rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: rafan 
State-Changed-When: Mon Jan 5 13:06:18 UTC 2009 
State-Changed-Why:  
MFC to both 6 and 7. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91980 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/91980: commit references a PR
Date: Mon,  5 Jan 2009 13:06:23 +0000 (UTC)

 Author: rafan
 Date: Mon Jan  5 13:06:03 2009
 New Revision: 186772
 URL: http://svn.freebsd.org/changeset/base/186772
 
 Log:
   MFC r184459
   
    - Whenever a password/shell is changed via rpc.yppasswdd, the daemon leaves
      one zombie process because it does not do the cleanup. For a long running
      NIS/YP server, it will have lots of zombie processes on it. Fix that by
      ignoring the SIGCHLD signal since we don't really care about the exit
      status in this case.
   
   PR:           bin/91980
   Reported by:  Arjan van der Velde <dj_noresult at hotmail.com>
   Submitted by: Jui-Nan Lin" <jnlin at csie.nctu.edu.tw>
   Reviewed by:  delphij
 
 Modified:
   stable/6/usr.sbin/rpc.yppasswdd/   (props changed)
   stable/6/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
 
 Modified: stable/6/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
 ==============================================================================
 --- stable/6/usr.sbin/rpc.yppasswdd/yppasswdd_main.c	Mon Jan  5 12:58:43 2009	(r186771)
 +++ stable/6/usr.sbin/rpc.yppasswdd/yppasswdd_main.c	Mon Jan  5 13:06:03 2009	(r186772)
 @@ -165,6 +165,7 @@ main(int argc, char *argv[])
  	struct sockaddr_in saddr;
  	socklen_t asize = sizeof (saddr);
  	struct netconfig *nconf;
 +	struct sigaction sa;
  	void *localhandle;
  	int ch;
  	char *mastername;
 @@ -268,6 +269,9 @@ the %s domain -- aborting", yppasswd_dom
  		}
  	}
  	openlog("rpc.yppasswdd", LOG_PID, LOG_DAEMON);
 +	memset(&sa, 0, sizeof(sa));
 +	sa.sa_flags = SA_NOCLDWAIT;
 +	sigaction(SIGCHLD, &sa, NULL);
  
  	rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL);
  	rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
