Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 13:23:11 -0700 (PDT)
From:      Paulo Fragoso <paulo@nlink.com.br>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/39306: The /etc/rc file should know if is running on jail or host enviroment.
Message-ID:  <200206142023.g5EKNBB7083743@www.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 14 13:30:01 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206142023.g5EKNBB7083743>