Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Sep 2007 09:29:51 +0200
From:      Albert Shih <Albert.Shih@obspm.fr>
To:        Aminuddin <amin.scg@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Sharing application jail and host?
Message-ID:  <20070926072951.GA64459@pcjas.obspm.fr>
In-Reply-To: <46f9ac0f.27f8720a.1eea.2115@mx.google.com>
References:  <20070925230101.CC5F816A54D@hub.freebsd.org> <46f9ac0f.27f8720a.1eea.2115@mx.google.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 Le 26/09/2007 à 08:47:05+0800, Aminuddin a écrit
> Hi freebsd gurus,
> I'm playing with jail setup and wanted to provide a virtual server to my
> external remote users to login by ssh and run a couple of applications.
> 
> Do I need to install the application using the ports in the jail itself or
> can I just install the application in the host environment? Is there any
> methods to enable sharing of the application across the jail and host?
> 
Yes it's possible, but if you just begin use jail and if you don't have
disk space problem it's better simple to install all applications in each
jail.

But if don't want to do this this is what you can do :

	Make on reference jail (don't let user have access) only for
	reference for example you can install this in

		/jail/REF


	After that you create a new jail in

		/jail/new-jail

	with in root dir

		total 15
		drwxr-xr-x  18 root  wheel   512 Jan 15  2007 REF
		lrwxr-xr-x   1 root  wheel     7 Dec 19  2006 bin -> REF/bin
		lrwxr-xr-x   1 root  wheel     8 Dec 19  2006 boot -> REF/boot
		dr-xr-xr-x   4 root  wheel   512 Mar 12  2007 dev
		drwxr-xr-x  18 root  wheel  2048 Feb  1  2007 etc
		drwxr-xr-x  19 root  wheel  1024 Dec 19  2006 etc-local
		lrwxr-xr-x   1 root  wheel     7 Dec 19  2006 lib -> REF/lib
		lrwxr-xr-x   1 root  wheel    11 Dec 19  2006 libexec -> REF/libexec
		dr-xr-xr-x   1 root  wheel     0 Sep 26 09:24 proc
		drwxr-xr-x   4 root  wheel   512 Jul  5 21:56 root
		lrwxr-xr-x   1 root  wheel     8 Dec 19  2006 sbin -> REF/sbin
		drwxr-xr-x   3 root  wheel   512 Dec 18  2006 share
		drwxrwxrwt   6 root  wheel   512 Sep 26 03:01 tmp
		lrwxr-xr-x   1 root  wheel     7 Dec 19  2006 usr -> REF/usr
		drwxr-xr-x  22 root  wheel   512 Mar 12  2007 var

	the

		/jail/new-jail/usr/local/etc is a link to /etc-local

	After that you mount in nullfs the /jail/REF in /jail/new-jail/REF
	by using

		/jail/REF               /jail/new-jail/REF nullfs  rw      0       0

	in your fstab.

	
	When you finish you can install the application only in your REF
	jail and automaticaly is install in all your jail.

The «danger» with this method is when you in the new-jail-21 (for example)
after some time you forget you using nullfs and .... you erase something
useless for new-jail-21 but absolutly need by new-jail-19....Because in a
jail you cannot see it's using nullfs.

Regards.



--
Albert SHIH
Observatoire de Paris Meudon
SIO batiment 15
Téléphone : 01 45 07 76 26
Heure local/Local time:
Mer 26 sep 2007 09:20:27 CEST



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