From nectar@gw.nectar.com Fri Oct 15 18:40:42 1999
Return-Path: <nectar@gw.nectar.com>
Received: from gw.nectar.com (gw.nectar.com [209.98.143.44])
	by hub.freebsd.org (Postfix) with ESMTP id 63FA614D22
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 15 Oct 1999 18:40:33 -0700 (PDT)
	(envelope-from nectar@gw.nectar.com)
Received: (from nectar@localhost)
	by bone.nectar.com (8.9.3/8.9.3) id RAA00744;
	Fri, 15 Oct 1999 17:40:56 -0500 (CDT)
	(envelope-from nectar)
Message-Id: <199910152240.RAA00744@bone.nectar.com>
Date: Fri, 15 Oct 1999 17:40:56 -0500 (CDT)
From: Jacques Vidrine <n@nectar.com>
Sender: nectar@gw.nectar.com
Reply-To: n@nectar.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: vinum and ``some processes would not die; ps axl advised'' at shutdown
X-Send-Pr-Version: 3.2

>Number:         14356
>Category:       kern
>Synopsis:       [vinum] vinum and ``some processes would not die; ps axl advised'' at shutdown
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    le
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 15 22:50:05 PDT 1999
>Closed-Date:    Fri Nov 04 20:11:28 GMT 2005
>Last-Modified:  Fri Nov 04 20:11:28 GMT 2005
>Originator:     Jacques Vidrine
>Release:        FreeBSD 3.3-STABLE i386
>Organization:
Discordian
>Environment:

	FreeBSD 3.3-STABLE i386

>Description:

	At system shutdown, init(8) sends signals to all child processes
	over a period of 20 seconds.  If any of these process fail to
        exit, it displays a warning message ``some processes would not 
	die; ps axl advised'' so that the system administrator can try
	to determine what has wedged.

	The vinum(4) daemon process is a child of init, but will never
	exit. It ignore all signals.  Therefore, if the system is
	utlizing vinum, init will always display its diagnostic at
	system shutdown time.  This is both annoying and potentially
	damaging (most system administrators would probably take to
	ignoring the diagnostic even when a real problem might exist).

>How-To-Repeat:

	# vinum start
	# shutdown now

>Fix:
	
	When the vinum daemon starts, it should orphan itself so that
	init doesn't wait for it at system shutdown time.

	Also, I think that the vinum daemon process should be marked
	with the P_SYSTEM process flag (no signals, no swapping).

	The following patch applies to -STABLE, and probably to
	-CURRENT as well.  I've tested it only on -STABLE, and it
	behaves as expected.

--- src/sys/kern/kern_exit.c	1999/08/29 16:25:59	1.71.2.4
+++ src/sys/kern/kern_exit.c	1999/10/15 22:16:53
@@ -562,7 +569,8 @@
 		return;
 
 	LIST_REMOVE(child, p_sibling);
-	LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
+	if (parent != NULL)
+	    LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
 	child->p_pptr = parent;
 }
 
--- src/sys/dev/vinum/vinumdaemon.c	1999/08/29 16:24:15	1.1.2.6
+++ src/sys/dev/vinum/vinumdaemon.c	1999/10/15 22:23:29
@@ -74,6 +74,8 @@
 		log(LOG_INFO, "vinumd: abdicating\n");
 	    return;
 	}
+	proc_reparent(curproc, NULL);
+	curproc->p_flag |= P_SYSTEM;
 	while (daemonq != NULL) {			    /* we have work to do, */
 	    s = splhigh();				    /* don't get interrupted here */
 	    request = daemonq;				    /* get the request */


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->grog 
Responsible-Changed-By: nectar 
Responsible-Changed-When: Sat Oct 16 05:33:25 PDT 1999 
Responsible-Changed-Why:  
vinum is Greg's baby 
State-Changed-From-To: open->closed 
State-Changed-By: grog 
State-Changed-When: Tue Feb 15 16:05:16 PST 2000 
State-Changed-Why:  
Problem resolved. 
State-Changed-From-To: closed->open 
State-Changed-By: nectar 
State-Changed-When: Tue May 16 12:48:49 PDT 2000 
State-Changed-Why:  
Re-opened to auto-annoy Greg.  See kern/16713. 
Responsible-Changed-From-To: grog->le 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 9 19:09:32 GMT 2004 
Responsible-Changed-Why:  
With permission of both, reassign from grog to le. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14356 
State-Changed-From-To: open->closed 
State-Changed-By: ceri 
State-Changed-When: Fri Nov 4 20:10:27 GMT 2005 
State-Changed-Why:  
This has been fixed according to grog. 

Even if that isn't the case, it's unlikely to get fixed unless it 
persists in the gvinum world. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14356 
>Unformatted:

Greg Lehey, 19 October 1999

	I haven't seen this.  After feedback from the submitter, it
	appears that it only occurs when shutdown is to single-user
	mode.  I'll look at this next time I have access to a Vinum
	machine.

Greg Lehey, 16 February 2000

	It turned out that the problem did happen at other times.  It
	was fixed in revision 1.16 (-CURRENT) and 1.1.2.7 (3-STABLE)
	of vinumdaemon.c.

