From owner-freebsd-current@FreeBSD.ORG Tue Aug 9 21:43:19 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A84316A41F for ; Tue, 9 Aug 2005 21:43:19 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id B291A43D48 for ; Tue, 9 Aug 2005 21:43:18 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by postfix3-2.free.fr (Postfix) with ESMTP id 21AEBC0B9; Tue, 9 Aug 2005 23:43:17 +0200 (CEST) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id 0BD95405B; Tue, 9 Aug 2005 23:43:30 +0200 (CEST) Date: Tue, 9 Aug 2005 23:43:30 +0200 From: Jeremie Le Hen To: drvince@anonymnet.net Message-ID: <20050809214330.GZ45385@obiwan.tataz.chchile.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Cc: freebsd-current@freebsd.org Subject: Re: More into /etc/rc.d/jail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 21:43:19 -0000 Hi, > Hi, > I'm using jails inside md devices to limit the disk space each jail can use. It's working great but I have to start manually all of them at startup. Here's my drill: > > mdconfig -a -t vnode -f ${IMAGE} -u ${ID} > fsck_ufs /dev/md${ID}c > mount /dev/md${ID}c ${DEST} > mount_devfs devfs ${DEST}/dev > jail -l -U root ${DEST} ${FQDN} ${IP} /bin/sh /etc/rc > > Therefore, I can't use the /etc/rc.d/jail facility. So I thought, it would be good to add *fsck before mounting* and an optional mdconfig beforehand. > > jail_${NAME}_md_device="" # The device to attach or NO > jail_${NAME}_image="" # The image file containing the jail, used with md_device > jail_${NAME}_fsck_options="" # Options to pass to fsck > > In fsck_options I could put "-t ufs". Of course, /dev/md${ID}c must be present before mounting, could happen if the image isn't bsdlabel'ed. > > I'm a terrible coder, I could do it, but I'll need coaching and I've never made a patch. I would gladly hand that to someone else but I also need it to be done, I can't babysit the server forever. So, how does it sound? This was recently discussed in some thread. The problem with this approach is that file backed md(4) devices are too slow to make it standard. This is why this won't go into FreeBSD, IMHO. If you can find the scattered thread called "limit jail disk space" on this page : http://lists.freebsd.org/pipermail/freebsd-hackers/2005-July/thread.html You will also find a very small port of FreeVPS for FreeBSD that might bring what you are looking for (although I've not tested personal). Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >