[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] running cvsup in a jail

Frédéric Perrin wrote:
Le mardi 25 à 12:59, Joe a écrit :
When I run cvsup from within a jail I get an error "can't write to a protected read-only location. I read the list archives and found thread on subject "portupgrade in a jail". The /usr/jails/basejail/usr/share/examples/cvsup/ports-supfile may need correcting in the same manner as /etc/make.config had for portupgrade.
But I don't know enough about how ezjail works to figure it out.
Would sure welcome some guidance from this list.

AIUI, this thread was more about tools that manage ports and wanted to
write to /usr/ports while they shouldn't need to, than about updating
the ports tree.

/usr/ports (in the jail) is a symlink to /basejail/usr/ports,
and /basejail is indeed read-only, so (by design) cvsup from inside the
jail can't update the jail's port tree.

If you want to update the port tree for all your jails, use
« ezjail-admin update -P » from the host. If you have only one jail for
which you want to have the latest tree, from this jail break
the /usr/ports -> /basejail/usr/ports link, and « portsnap fetch &&
portsnap extract » a brand new ports tree. If you are in an
intermediate situation, e.g. you have half of your jails in production
with a port tree that shouldn't move and the other half should have the
latest tree, you'll have to do some manual tweaking.

I suppose the cleanest way would be to have a /usr/jails/basejail/usr/ports-last
as well as a .../basejail/usr/ports-prod tree. Then, inside each jail,
you create a /usr/ports -> /basejail/usr/ports-XXX symlink, depending on
which ports tree you want. Setting this symlink looks like the perfect
use case for a jail flavour.

Thank you for your reply. But its based on having portsnap download the complete ports tree. I have not needed the complete ports tree since RELEASE 3.0. I use the package system for every thing except for ports I need to change the config. Such as php5 to turn off all options and turn on the apache module option. In these type of cases I cvsup the port-base and just the php5 port make files. All of php5 dependents are pkg_add and when I do "make install" on php5 port, all the dependents modules are found and the php5 compile is successfully. Now I use the same procedure for jails by first stopping all the jails and running my cvsup procedures from the host targeting the jail directory paths. I modify the supfile *default base=/usr/jails/apache22/var/db and *default prefix=/usr/jails/basejail/usr statements. In this case I am installing php5 for the apache22 jail. After cvsup downloads the selected port make files, I then start the apache22 jail, cd to the php5 ports directory and do "make install". Everything works fine.

Now what I am asking is there some way to customize the apache22 jail and the basejail so the /usr/ports directory is under the write control of the apache22 jail.

Maybe a clearer way of saying this is. I don't want the /usr/ports tree under basejail control but allocated as part of each new jail. Can this be done using jail flavour?