Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Nov 2008 16:33:30 -0600
From:      "Marcus I. Ryan" <marcus@riboflavin.net>
To:        freebsd-questions <freebsd-questions@freebsd.org>, freebsd-ports@freebsd.org
Subject:   Jails and common ports
Message-ID:  <20081120163330.amssmoq1c8ksskg0@www.riboflavin.net>

next in thread | raw e-mail | index | archive | help
Cross-posting this to freebsd-ports because it's mostly about the =20
ports infrastructure and how I might (ab)use it...

I'm looking into setting up jails, and was hoping I was onto something =20
with using ports to maintain application software but I hit a snag and =20
I'm hoping someone can either tell me how to do what I want or at =20
least say "nope...you're on crack thinking that will work" ;)

I'm trying to set up a number of jails on my system following the =20
handbook suggestions for "Application of Jails" =20
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-application=
.html).  That means I have a master read-only instance for the base system (=
world), and read-write instances of key directories for each jail.  This is =
ideal for what I'd like to do because I only have to do one world upgrade to=
 upgrade all my =20
jails.

I'd like to extend that idea to a number of common ports.  For =20
instance, I'd like to have gettext, libtool, etc., installed once and =20
be able to do a single portupgrade to update it for all jails.

My initial plan was to make an /opt folder in the master filesystem =20
and use the master jail to install ports (PREFIX=3D/opt and =20
LOCALBASE=3D/opt).  I added the /opt/bin and /opt/sbin to the path and =20
/opt/lib to the ld_config directories for the child jails and they =20
were indeed able to see the first couple of ports I installed.

However, I started hitting issues with libtool and friends.  The =20
children would not find them, and would go ahead and start installing =20
their own local copies of those ports.  Turns out quite a few tools =20
are defined in /usr/ports/Mk/* and are defined relative to LOCALBASE.  =20
If I leave LOCALBASE and PREFIX alone in the child jails so they'll =20
use /usr/local for their specific ports, I can't recognize and use =20
other ports like libtool installed in /opt; it doesn't seem right to =20
set LOCALBASE in the child jails since I want them to use /usr/local =20
for anything I haven't provided.

I really would like to avoid the "joy" of making hard-links, etc., for =20
all the files in the common packages, but I didn't see any way to =20
override settings for these individual ports.  I did edit some =20
Makefiles and add '--prefix=3D/opt' to the CONFIGURE_ARGS for those =20
ports, and everything worked fine, but I'd prefer to do it "the right =20
way" (e.g. not editing Makefiles).

Is there a variable I'm not seeing that would allow me to do this kind =20
of crazy thing, or am I better off either setting up hard links and/or =20
using automated package building and just repeating pkg_upgrades in =20
each jail?

If it's the latter, does someone know of a decent all-in-one doc to =20
help me at least set up some features so I update ports once in a =20
master and just get packages from the same place (I can piece it =20
together myself from all the other docs I've found and been reading, =20
but if someone has already written it up, hate to reinvent it myself =20
:) ).

Thanks in advance.

--=20
Marcus I. Ryan, marcus@riboflavin.net
------------------------------------------
People often find it easier to be a result
of the past than a cause of the future.
------------------------------------------







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