A proper way to install ports into a jail, from the host machine

Brian Reichert reichert at numachi.com
Fri Jun 18 23:11:39 GMT 2004


On Fri, Jun 18, 2004 at 07:47:58AM -0700, Kevin Way wrote:
> The issue occurs when you want to setup/upgrade machines that have N 
> jails on them.  Right now I can install the majority of ports like 
> this:
> 
> 	jail_portinstall shells/zsh all

I've never used 'jail_portinstall', so have no idea what it's
semantics are.

>  and zsh will get installed into every single jail.  The place where 
> this falls apart is jails that do user/group management.  The checks 
> for user/group existence, and the commands for adding users/groups are 
> generally hard coded such that it's not possible to specify an 
> alternate etc directory, or to ensure that you set file ownership 
> correctly if you modify it manually.

What, like this:

  pw -V ${TESTJAIL}/etc groupadd -n wheel -g 0
  pwd_mkdb -d ${TESTJAIL}/etc ${TESTJAIL}/etc/master.passwd
  pw -V ${TESTJAIL}/etc useradd -n root -u 0 -g wheel

I couldn't set passwords, though...

Other trick: go though the hassle of building one reference jail,
then use rsync to crank out as many copies as you want.  It a good
quick way to 'reset' a jail after use...  (Or, if you're worried
about special flags, maintain a star archive...)

> We're looking for feedback on whether a patchset that attempts to 
> modularize the user/group tests would receive any acceptance, and also 
> to find out if anybody else is currently looking at solving this 
> problem.

Hmmm, good luck...

> Kevin Way
> InsideSystems

-- 
Brian Reichert				<reichert at numachi.com>
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			BSD admin/developer at large	


More information about the freebsd-ports mailing list