Containment Units

The wonderful thing about using FreeBSD is that there are a multitude of well written documents explaining the design principles & functioning of pieces of the operating system. It's a fact that distributing changes to anything is a slow, fraught process. Even, perhaps especially, documentation.

So now I know two valid ways to write out the directory tree in which to incarcerate one or more processes in jail.

  1. The fast & trusting of others way:

    D=/here/is/the/jail
    fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz -o /usr/local/jails/media/14.2-RELEASE-base.txz
    mkdir -p $D
    tar -xf /usr/local/jails/media/14.2-RELEASE-base.txz -C $D --unlink
    
  2. the slow & paranoid way:

    D=/here/is/the/jail
    cd  /usr/src
    mkdir -p $D
    make world  DESTDIR=$D
    make distribution DESTDIR=$D
    
  3. late-breaking non-news; while writing this, I learned of yet another method using bsdinstall:

    D=/here/is/the/jail
    bsdinstall jail $D
    

Yes, I'm aware that multiple jail management tools exist; I can only learn by doing things the difficult way. I've got a couple of jails going as a kind of low key stress test using 2/3 of the above methods. I'll be tearing them all down & rebuilding them again, assuredly.

links

social