[OpenIndiana-discuss] add inherit-pkg-dir

Jim Klimov jimklimov at cos.ru
Tue May 22 23:38:34 UTC 2012


2012-05-23 1:20, Tim Dunphy написал:
> Hello list,
>
> I'm trying to get a solaris zone to inherit a package dir under openindiana 151:
>
> These are the instructions I'm trying to follow:
>
>
> zonecfg:apps>  add inherit-pkg-dir
> zonecfg:apps:inherit-pkg-dir>  set dir=/opt/sfw
> zonecfg:apps:inherit-pkg-dir>  end
>
> This is the blog where I found them:
>
> http://saifulaziz.com/2009/08/09/solaris-containers-zones-howto/?blogsub=confirming#subscribe-blog
>
> This is what happens when I try to do the above:
>
> [root at openindiana:/export/home/bluethundr] #zonecfg -z lb1
> zonecfg:lb1>  add inherit-pkg-dir
> usage:
> add<resource-type>
>          (global scope)
> add<property-name>  <property-value>
>          (resource scope)
> zonecfg:lb1>
>
> All I get is usage output. What am I doing wrong here? Also I'd like
> to get this zone to inherit /usr/local from the global zone. How would
> I go about that?

Unfortunately, "inherit-pkg-dir" was an important part of
"sparse-root" local zones, which was incompatible with IPS
packaging ideology, so it was cut out of OpenSolaris Indiana
as well as its descendants (OpenIndiana, Solaris 11).

Now you have to do complete installs of local zones according
to the current OSes' manuals.

As for "inheriting" /usr/local, here's a couple of things
you could do:
1) If it is a separate ZFS dataset, you could make its
snapshot and clone, and "zfs rename" this clone into the
local zone;
2) The supported way, which should work regardless of where
the root fs and local zone root reside - you define a "lofs"
(loopback-mounted fs) which mounts your global zone's dir
into the local zone. You can have it read-write (and the
LZ can then change the GZ's data and programs under this
dir), or you can keep it read-only and LZ can not modify
the directory contents.

Snippet for zonecfg:

add fs
set dir=/usr/local
set special=/usr/local
set type=lofs
add options nodevices,ro
end

You have to create the mountpoint in the local zone manually.

3) Mix options 1 and 2, to provide the local zone with a
clone of global zone's /usr/local which it can write to
without harm for the GZ.

 From your other post I believe you might need this for the
three scripts Oracle puts into /usr/local/bin. IIRC they
are not critical and the DBMS should work without them.
Alternately, it would do little harm if these scripts
are available to the GZ and all zones who lofs-mount your
/usr/local as in method (2). In this case you'd likely
have to allow writing to /usr/local during installation
of the DBMS, then you can set the lofs-mount to read-only.


> thanks!
> Tim


HTH,
//Jim



More information about the OpenIndiana-discuss mailing list