Bug 14356

Summary: [vinum] vinum and ``some processes would not die; ps axl advised'' at shutdown
Product: Base System Reporter: Jacques Vidrine <n>
Component: kernAssignee: le
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   

Description Jacques Vidrine 1999-10-16 06:50:05 UTC
	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).

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 */
How-To-Repeat: 
	# vinum start
	# shutdown now
Comment 1 Jacques Vidrine freebsd_committer freebsd_triage 1999-10-16 13:33:25 UTC
Responsible Changed
From-To: freebsd-bugs->grog

vinum is Greg's baby 
Comment 2 Greg Lehey freebsd_committer freebsd_triage 2000-02-16 00:05:16 UTC
State Changed
From-To: open->closed

Problem resolved. 
Comment 3 Jacques Vidrine freebsd_committer freebsd_triage 2000-05-16 20:48:49 UTC
State Changed
From-To: closed->open

Re-opened to auto-annoy Greg.  See kern/16713. 
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2004-09-09 20:09:32 UTC
Responsible Changed
From-To: grog->le

With permission of both, reassign from grog to le.
Comment 5 Ceri Davies freebsd_committer freebsd_triage 2005-11-04 20:10:27 UTC
State Changed
From-To: open->closed

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.