From root@crepe2.monkeybrains.net  Sun Dec  4 01:35:50 2005
Return-Path: <root@crepe2.monkeybrains.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4871016A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Dec 2005 01:35:50 +0000 (GMT)
	(envelope-from root@crepe2.monkeybrains.net)
Received: from crepe2.monkeybrains.net (crepe2.monkeybrains.net [69.22.154.9])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D67C143D53
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Dec 2005 01:35:49 +0000 (GMT)
	(envelope-from root@crepe2.monkeybrains.net)
Received: from crepe2.monkeybrains.net (localhost [127.0.0.1])
	by crepe2.monkeybrains.net (8.13.4/8.13.4) with ESMTP id jB40OdCx064315
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 3 Dec 2005 16:24:39 -0800 (PST)
	(envelope-from root@crepe2.monkeybrains.net)
Received: (from root@localhost)
	by crepe2.monkeybrains.net (8.13.4/8.13.3/Submit) id jB40Odeu064314;
	Sat, 3 Dec 2005 16:24:39 -0800 (PST)
	(envelope-from root)
Message-Id: <200512040024.jB40Odeu064314@crepe2.monkeybrains.net>
Date: Sat, 3 Dec 2005 16:24:39 -0800 (PST)
From: crapsh@monkeybrains.net
Reply-To: crapsh@monkeybrains.net
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] /etc/rc.d/jail restart ignores command line jail_list
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         89911
>Category:       conf
>Synopsis:       [patch] /etc/rc.d/jail restart ignores command line jail_list
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 04 01:40:07 GMT 2005
>Closed-Date:    Thu May 11 13:09:32 GMT 2006
>Last-Modified:  Thu May 11 13:09:32 GMT 2006
>Originator:     Rudy Rucker
>Release:        FreeBSD 6.0-STABLE amd64
>Organization:
MonkeyBrains.net
>Environment:
System: FreeBSD crepe2.monkeybrains.net 6.0-STABLE FreeBSD 6.0-STABLE #1: Mon Nov 28 15:19:29 PST 2005 root@crepe2.monkeybrains.net:/usr/obj/usr/src/sys/OPTERON amd64


	
>Description:
	
The following command:
	/etc/rc.d/jail restart jail_name
Restarts all jails configured in /etc/rc.conf.
The more desirable result is for the restart command to act like the stop and start
commands.  These commands will stop and start *individual* jail(s) listed in $*.
>How-To-Repeat:
	/etc/rc.d/jail restart jail_name
>Fix:

--- jail        Tue Oct 25 17:39:39 2005
+++ jail.new    Sat Dec  3 16:15:43 2005
@@ -248,4 +248,16 @@
        shift
 fi
 [ -n "$*" ] && jail_list="$*"
+
+# restart calls 'stop' and 'start' and loses the jail_list
+# stop the jail_list from the command line in a variable and export it.
+# Check for it and reset the jail_list
+if [ -n "$_jail_restart_list" ]; then
+       jail_list=$_jail_restart_list
+fi
+if [ $cmd = 'restart' ] && [ -n $jail_list ]; then
+       _jail_restart_list=$jail_list;
+       export _jail_restart_list
+fi
+  
 run_rc_command "${cmd}"  


>Release-Note:
>Audit-Trail:

From: "Support (Rudy)" <support@monkeybrains.net>
To: bug-followup@FreeBSD.org, crapsh@monkeybrains.net
Cc:  
Subject: Re: conf/89911 : [patch] /etc/rc.d/jail restart ignores command line
 jail_list
Date: Mon, 05 Dec 2005 15:15:50 -0800

 I forgot some quotes and made the comment easier to read.
 Spefically the quotes in this line:
     [ -n "$jail_list" ]
 
 Here is the new diff:
 
 --- usr/src/etc/rc.d/jail       Tue Aug 16 01:43:06 2005
 +++ /etc/rc.d/jail      Mon Dec  5 15:11:13 2005
 @@ -248,4 +248,15 @@
          shift
   fi
   [ -n "$*" ] && jail_list="$*"
 +
 +# Store the jail_list passed from the command line in an environment 
 variable.
 +# Check for the varibable reset the jail_list if found.
 +if [ -n "$_jail_restart_list" ]; then
 +       jail_list=$_jail_restart_list
 +fi
 +if [ $cmd = 'restart' ] && [ -n "$jail_list" ]; then
 +       _jail_restart_list=$jail_list;
 +       export _jail_restart_list
 +fi
 +
   run_rc_command "${cmd}"
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Fri Jan 20 13:44:16 UTC 2006 
Responsible-Changed-Why:  
Take this one 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89911 
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Fri Jan 20 20:47:12 UTC 2006 
State-Changed-Why:  
Do you still have this issue?  
I cannot reproduce it: /etc/rc.d/jail restart $JAILNAME works perfectly here 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89911 
State-Changed-From-To: feedback->closed 
State-Changed-By: matteo 
State-Changed-When: Thu May 11 13:08:57 UTC 2006 
State-Changed-Why:  
Feedback timeout. I wasn't able to reproduce the problem anyway.. 

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