From nobody@www.freebsd.org  Fri Jun 14 13:23:13 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 65A3C37B42F
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Jun 2002 13:23:12 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g5EKNBhG083744
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Jun 2002 13:23:11 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g5EKNBB7083743;
	Fri, 14 Jun 2002 13:23:11 -0700 (PDT)
Message-Id: <200206142023.g5EKNBB7083743@www.freebsd.org>
Date: Fri, 14 Jun 2002 13:23:11 -0700 (PDT)
From: Paulo Fragoso <paulo@nlink.com.br>
To: freebsd-gnats-submit@FreeBSD.org
Subject: The /etc/rc file should know if is running on jail or host enviroment.
X-Send-Pr-Version: www-1.0

>Number:         39306
>Category:       conf
>Synopsis:       The /etc/rc file should know if is running on jail or host enviroment.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 14 13:30:01 PDT 2002
>Closed-Date:    Mon Mar 20 20:16:49 GMT 2006
>Last-Modified:  Mon Mar 20 20:16:49 GMT 2006
>Originator:     Paulo Fragoso
>Release:        4.5-RELEASE-p5
>Organization:
Nlink ISP
>Environment:
FreeBSD fisica.df.ufpe.br 4.5-RELEASE-p5 FreeBSD 4.5-RELEASE-p5 #3: Fri May 24 17:10:23 BRT 2002
paulo@gateway.df.ufpe.br:/usr/src/sys/compile/KERNEL1  i386
>Description:
      We have a jail enviroment running fine. The host enviroment have
mounted this partitions:

Filesystem    Size   Used  Avail Capacity  Mounted on
/dev/da0s1a    93M    40M    46M    46%    /
/dev/da0s2h   463M    17M   409M     4%    /home
/dev/da0s3e    98M    25M    66M    27%    /j
/dev/da0s4g    24G   3.2G    19G    15%    /j/home
/dev/da0s3f   252M   7.3M   224M     3%    /j/tmp
/dev/da0s3h   2.0G  1014M   841M    55%    /j/usr
/dev/da0s3a   1.4G   318M   981M    24%    /j/usr/local
/dev/da0s3g   252M   100M   132M    43%    /j/var
/dev/da0s4e  1008M   423M   504M    46%    /j/var/qmail
/dev/da0s4f  1008M    80M   847M     9%    /j/var/spool
/dev/da0s2e   252M   7.1M   225M     3%    /tmp
/dev/da0s2g   2.5G   1.0G   1.3G    45%    /usr
/dev/da0s2f   252M    16M   216M     7%    /var
procfs        4.0K   4.0K     0B   100%    /proc

which /j/... are for jail enviroment and /j/home have "userquota"
option.

All work fine, but in the jail enviroment we can't run repquota so we've
decided to put one single line in the fstab in jail, after that we can
run repquota command:

jail's fstab:
/dev/null               /home   ufs     rw,userquota    2       2

Now we can run repquota fine on jail enviroment.

The problem appear after reboot, /j/home is umounted when starting
jail script. We discover that it's happen because there is an "umount"
in the /etc/rc file. After commented out this line we can do everthing
without problem.
>How-To-Repeat:
     To create a jail enviroment ($D=/j) following "man jail", with
several partition like this:

/
/home
/j
/j/home
/j/tmp
/j/usr
/j/usr/local
/j/var
/j/var/qmail
/j/var/spool
/tmp
/usr
/var
/proc

If you put one line single line in the fstab for jail enviroment,
like this:

/dev/null               /home   ufs     rw,userquota    2       2

/j/home is umounted, becuse it isn't busy for any process.
>Fix:
      Our suggestion is to put something like this in the /etc/rc:

case ${jail_fstab} in
        [Nn][Oo])
        umount -a >/dev/null 2>&1
esac

instead only "umount -a >/dev/null 2>&1" and in the /etc/default/rc.conf:

jail_fstab="NO"         # Set to YES if you are using fstab in the jail
                        # enviroment
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Mon Mar 20 19:05:06 UTC 2006 
State-Changed-Why:  
Does the problem exist in recent -RELEASEs? (I'm thinking about RELENG_6 ) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39306 
State-Changed-From-To: feedback->closed 
State-Changed-By: matteo 
State-Changed-When: Mon Mar 20 20:15:46 UTC 2006 
State-Changed-Why:  
Submitter said the problem no longer exists 


Responsible-Changed-From-To: freebsd-bugs->matteo	 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Mon Mar 20 20:15:46 UTC 2006 
Responsible-Changed-Why:  
Grab ownership just in case 

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