From nobody@FreeBSD.org  Fri May 12 08:50:25 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 7C52516A401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 May 2006 08:50:25 +0000 (UTC)
	(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 317EC44245
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 May 2006 08:50:25 +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 k4C8oPwC044688
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 May 2006 08:50:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k4C8oPsE044687;
	Fri, 12 May 2006 08:50:25 GMT
	(envelope-from nobody)
Message-Id: <200605120850.k4C8oPsE044687@www.freebsd.org>
Date: Fri, 12 May 2006 08:50:25 GMT
From: m m <needacoder@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Bug in /etc/rc.d/jail startup script
X-Send-Pr-Version: www-2.3

>Number:         97166
>Category:       conf
>Synopsis:       Bug in /etc/rc.d/jail startup script
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    flz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 12 09:00:34 GMT 2006
>Closed-Date:    Mon Jul 10 11:26:10 GMT 2006
>Last-Modified:  Mon Jul 10 11:26:10 GMT 2006
>Originator:     m m
>Release:        6.1
>Organization:
>Environment:
FreeBSD 6.1-STABLE #14: Thu May 11 23:14:19 EDT 2006
>Description:
Using the jail_list feature in rc.conf no longer works for starting up multiple jails at boot time if fstab.<jail> files are used for jail fstab.

Problem appears to be at or near these lines:

  # "/etc/fstab.${_j}" will be used for {,u}mount(8) if none is specified.
  eval jail_fstab=\"\${jail_${_j}_fstab:-${jail_fstab}}\"

the first jail starts up correctly, info output:

May 12 00:51:29 host root: /etc/rc: INFO: hosting root: /usr/jails/hosting/slash
May 12 00:51:29 host root: /etc/rc: INFO: hosting devdir: /usr/jails/hosting/slash/dev
May 12 00:51:29 host root: /etc/rc: INFO: hosting fdescdir: /usr/jails/hosting/slash/dev/fd
May 12 00:51:29 host root: /etc/rc: INFO: hosting procdir: /usr/jails/hosting/slash/proc
May 12 00:51:29 host root: /etc/rc: INFO: hosting ruleset: devfsrules_jail
May 12 00:51:29 host root: /etc/rc: INFO: hosting fstab: /etc/fstab.hosting
..
May 12 00:51:29 host root: /etc/rc: INFO: Mounting fstab for jail hosting (/etc/fstab.hosting)
..
May 12 00:51:30 host root: /etc/rc: INFO: devfs_domount(): mount-point is (/usr/jails/hosting/slash/dev), ruleset is (devfsrules_jail)

subsequent jails fail to start up, info output:

May 12 00:51:37 host root: /etc/rc: INFO: mysql root: /usr/jails/mysql/slash
May 12 00:51:37 host root: /etc/rc: INFO: mysql devdir: /usr/jails/mysql/slash/dev
May 12 00:51:37 host root: /etc/rc: INFO: mysql fdescdir: /usr/jails/mysql/slash/dev/fd
May 12 00:51:37 host root: /etc/rc: INFO: mysql procdir: /usr/jails/mysql/slash/proc
May 12 00:51:37 host root: /etc/rc: INFO: mysql ruleset: devfsrules_jail
May 12 00:51:37 host root: /etc/rc: INFO: mysql fstab: /etc/fstab.hosting
.. 
May 12 00:51:37 host root: /etc/rc: INFO: Mounting fstab for jail mysql (/etc/fstab.hosting)
.. 
May 12 00:51:37 host root: /etc/rc: WARNING: devfs_domount(): Unable to mount devfs on /usr/jails/mysql/slash/dev

it looks like jail_fstab remains set from the first jail (/etc/fstab.hosting) so second jail never mounts fstab.mysql and dies on devfs_domount().

>How-To-Repeat:

>Fix:
setting explicit jail_bla_fstab=/etc/fstab.bla will helps.


>Release-Note:
>Audit-Trail:

From: Maxim Konovalov <maxim@macomnet.ru>
To: m m <needacoder@gmail.com>
Cc: bug-followup@freebsd.org
Subject: Re: conf/97166: Bug in /etc/rc.d/jail startup script
Date: Fri, 12 May 2006 13:10:54 +0400 (MSD)

 Hi,
 
 Could you please check a patch in kern/97079?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/97079
 
 Please let us know if it helps you.
 
 -- 
 Maxim Konovalov

From: Maxim Konovalov <maxim@macomnet.ru>
To: m m <needacoder@gmail.com>
Cc: bug-followup@freebsd.org
Subject: conf/97166
Date: Fri, 12 May 2006 13:25:50 +0400 (MSD)

 Would be even better to help Florent to test his fix.
 
 -- 
 Maxim Konovalov
 
 ---------- Forwarded message ----------
 Date: Fri, 12 May 2006 10:21:41 +0100
 From: Florent Thoumie <flz@freebsd.org>
 To: freebsd-current@freebsd.org
 Cc: freebsd-stable@freebsd.org
 Subject: Jail testers needed (rc.d/jail)
 
 Hey lists,
 
 Two or three days before the CVS tree has been tagged for FreeBSD
 6.1-RELEASE, I've committed a broken version of the jail rc.d script.
 
 The symptoms are:
 
 - an ifconfig error message if you don't define a jail_interface and
 have at least one jail configured, this one is harmless.
 - a problem with one of the following variable: jail_exec,
 jail_exec_start, jail_exec_stop, jail_flags and especially jail_fstab;
 if you have at least two jails configured.
 
 I committed yesterday a fix that should supposedly fix both of these
 issues so I'd need all jail users running either FreeBSD 6.1-RELEASE or
 6-STABLE (older than two days) to try the new script [1] and report the
 result, either successful or not. Once I'll get enough successful
 reports, I'll contact the Release Engineering team to make sure the
 patch makes it to the RELENG_6_1 branch.
 
 Sorry for the inconvenience.
 
 Note: Keep me CC'ed as I'm not (yet) subscribed to these lists.
 
 [1] http://cvsweb.freebsd.org/src/etc/rc.d/jail?rev=1.32
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Fri May 12 17:56:58 UTC 2006 
State-Changed-Why:  
Fixed in HEAD. 


Responsible-Changed-From-To: freebsd-bugs->flz 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Fri May 12 17:56:58 UTC 2006 
Responsible-Changed-Why:  
Over to Florent. 

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

From: "m m" <needacoder@gmail.com>
To: "Maxim Konovalov" <maxim@macomnet.ru>, "Florent Thoumie" <flz@freebsd.org>, 
	freebsd-stable@freebsd.org
Cc: bug-followup@freebsd.org
Subject: Re: conf/97166
Date: Fri, 12 May 2006 13:50:05 -0400

 > Hey lists,
 >
 > Two or three days before the CVS tree has been tagged for FreeBSD
 > 6.1-RELEASE, I've committed a broken version of the jail rc.d script.
 >
 > The symptoms are:
 >
 > - an ifconfig error message if you don't define a jail_interface and
 > have at least one jail configured, this one is harmless.
 > - a problem with one of the following variable: jail_exec,
 > jail_exec_start, jail_exec_stop, jail_flags and especially jail_fstab;
 > if you have at least two jails configured.
 >
 > I committed yesterday a fix that should supposedly fix both of these
 > issues so I'd need all jail users running either FreeBSD 6.1-RELEASE or
 > 6-STABLE (older than two days) to try the new script [1] and report the
 > result, either successful or not. Once I'll get enough successful
 > reports, I'll contact the Release Engineering team to make sure the
 > patch makes it to the RELENG_6_1 branch.
 >
 > Sorry for the inconvenience.
 >
 > Note: Keep me CC'ed as I'm not (yet) subscribed to these lists.
 >
 > [1] http://cvsweb.freebsd.org/src/etc/rc.d/jail?rev=3D1.32
 
 Appears to be working fine on releng_6 from last night - Thank you very muc=
 h!
State-Changed-From-To: patched->closed 
State-Changed-By: flz 
State-Changed-When: Mon Jul 10 11:13:06 UTC 2006 
State-Changed-Why:  
Errata has been published. 

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