Configuring packages from zone to zone

Configuring packages from zone to zone

Post by starm.. » Tue, 15 Mar 2005 03:17:27



How does one install software/packages in a zone? Particularly in
/usr/local when that filesystem is read-only?

I wanted my zone to have a samba instance, so I installed sun freeware
samba (and dependant packages) in the global zone, they were installed
to my non-global zone by default, but when I went to edit my smb.conf
in my non-global zone - it was a read-only filesystem!

Since a lot of software requires conf files, that will be different
from zone to zone, what is the best way to deal w/ this?

For non-global zones, is it best to compile source for software needing
separate configuration, installing it to a pseudo /usr/local - e.g. a
writable fs? Or is there some method to isolate packages (or just their
conf files) from one zone to the next?

Thanks,
s7

 
 
 

Configuring packages from zone to zone

Post by Casper H.S. Di » Tue, 15 Mar 2005 03:32:12



>I wanted my zone to have a samba instance, so I installed sun freeware
>samba (and dependant packages) in the global zone, they were installed
>to my non-global zone by default, but when I went to edit my smb.conf
>in my non-global zone - it was a read-only filesystem!

Why did you install the sunfreeware version and not the version
which shipped with Solaris?  It has the proper rw/ro split
of configuration files.

Casper

 
 
 

Configuring packages from zone to zone

Post by starm.. » Tue, 15 Mar 2005 11:29:00


Thanks Casper for the info,

How are config files kept separate if I'd used the package you
mentioned?

Must packages be created specially, with zones in mind, if they are to
work correctly in zones?

Do zone aware packages somehow keep track of the
different/corresponding conf files they'll have for each zone?

Thanks,
s7

p.s. Is my sunfreeware samba install useless outside of the global
zone?

 
 
 

Configuring packages from zone to zone

Post by Scott Howar » Tue, 15 Mar 2005 17:38:30



> How are config files kept separate if I'd used the package you
> mentioned?

Where config files are supposed to be stored - somewhere in /etc/  (in
the case of samba, /etc/sfw).

Quote:> Must packages be created specially, with zones in mind, if they are to
> work correctly in zones?

Not generally - they just need to be created to follow the filesystem
standards which have been around for many many years. eg, binaries in
/usr, config in /etc, logs in /var and so no.

Quote:> Do zone aware packages somehow keep track of the
> different/corresponding conf files they'll have for each zone?

There's no need - all of the config files for applications within a zone
are stored within that zone (/etc is always a separate, writeable
filesystem).

Quote:> p.s. Is my sunfreeware samba install useless outside of the global
> zone?

No. You could always set up a whole-root zone (which would have it's
own, writeable /usr). Alternatively there are a number of workarounds,
such as creating a symlink from /usr/local/bin/xxx.conf to somewhere in
/etc or another local filesystem - although I'd recommend against that
if you can.

   Scott

 
 
 

Configuring packages from zone to zone

Post by Klaus Gro » Tue, 15 Mar 2005 19:56:32



> How does one install software/packages in a zone? Particularly in
> /usr/local when that filesystem is read-only?

> I wanted my zone to have a samba instance, so I installed sun freeware
> samba (and dependant packages) in the global zone, they were installed
> to my non-global zone by default, but when I went to edit my smb.conf
> in my non-global zone - it was a read-only filesystem!

> Since a lot of software requires conf files, that will be different
> from zone to zone, what is the best way to deal w/ this?

> For non-global zones, is it best to compile source for software needing
> separate configuration, installing it to a pseudo /usr/local - e.g. a
> writable fs? Or is there some method to isolate packages (or just their
> conf files) from one zone to the next?

> Thanks,
> s7

Hey,

delete the inherit-pkg lines in the /etc/zones/<yourzone>.xml file.
Then the files form /usr and so on will be hard copied and the filesystems
will be read-write mounted form the zone. Now you will be able to install
software under /usr/local

good luck
Klaus Grote
DNS GmbH

 
 
 

Configuring packages from zone to zone

Post by Rodrick Brow » Tue, 15 Mar 2005 22:03:41





>> How does one install software/packages in a zone? Particularly in
>> /usr/local when that filesystem is read-only?

>> I wanted my zone to have a samba instance, so I installed sun freeware
>> samba (and dependant packages) in the global zone, they were installed
>> to my non-global zone by default, but when I went to edit my smb.conf
>> in my non-global zone - it was a read-only filesystem!

>> Since a lot of software requires conf files, that will be different
>> from zone to zone, what is the best way to deal w/ this?

>> For non-global zones, is it best to compile source for software needing
>> separate configuration, installing it to a pseudo /usr/local - e.g. a
>> writable fs? Or is there some method to isolate packages (or just their
>> conf files) from one zone to the next?
>> Thanks,
>> s7

> Hey,

> delete the inherit-pkg lines in the /etc/zones/<yourzone>.xml file.
> Then the files form /usr and so on will be hard copied and the filesystems
> will be read-write mounted form the zone. Now you will be able to install
> software under /usr/local

> good luck
> Klaus Grote
> DNS GmbH

No need to delete it from the xml file, you can explicitly remove the
inherit-pkg-dir from your zonecfg cli

--
Unix Systems Engineer
The City of New York (DoITT)
http://www.nyc.gov/doitt

http://www.rodrickbrown.com

 
 
 

Configuring packages from zone to zone

Post by starm.. » Wed, 16 Mar 2005 02:18:21


Thanks for the responses - this group is great.

If I'd made /usr/local its own slice - would I have avoided this? Or is
the shared /usr fs recursive across slices?

If /usr/local were it's own slice, would I even see it in my non-global
zones?
Would it be writeable per zone? If not, is there a way to make it so,
like /etc is?

Maybe it's better to install from source, installing to writable
locations,  or use packages which follow the convention Scott mentions?
Though most software I install goes in /usr/local by default!

Are Klaus and Rodrick's suggestions along the lines of what Scott
refers to as creating a "whole-root" non-global zone? I'd like to save
disk space, and keep packages more or less in-sync across zones, so
maybe sharing as much as possible is still better for me?

Thanks again,
s7

 
 
 

Configuring packages from zone to zone

Post by n.. » Wed, 16 Mar 2005 18:40:27




>> How does one install software/packages in a zone? Particularly in
>> /usr/local when that filesystem is read-only?

Make /usr/local a separate filesystem in each local zone? We do that
becasue lots of software installs in /usr/local/bin with configs in
/usr/local/etc.

Or this alternative from Klaus Grote:

Quote:> delete the inherit-pkg lines in the /etc/zones/<yourzone>.xml file.
> Then the files form /usr and so on will be hard copied and the filesystems
> will be read-write mounted form the zone. Now you will be able to install
> software under /usr/local

but this will cost you alot of disk space for the zone, as the zone needs
its own complete /usr in this case.

HTH, Erik.

 
 
 

Configuring packages from zone to zone

Post by n.. » Wed, 16 Mar 2005 18:48:03



> Thanks for the responses - this group is great.

> If I'd made /usr/local its own slice - would I have avoided this? Or is
> the shared /usr fs recursive across slices?

Not if you mount /usr/local in the global zone. If you allocate a slice
or softpartition or whatever for every zone's /usr/local, and mount
this /usr/local as part of the zone's configuration, it will be rw to
that zone.

Quote:> If /usr/local were it's own slice, would I even see it in my non-global
> zones?

Yes

Quote:> Would it be writeable per zone? If not, is there a way to make it so,
> like /etc is?

No, if you make /usr/local a filesystem/slice mounted in the global zone,
it'll be ro in any non-global zone as it's below /usr. To have /usr/local
be writable for a zone you need to define it as a filesystem local to
to zone only (in de zone's config).

Quote:

> Maybe it's better to install from source, installing to writable
> locations,  or use packages which follow the convention Scott mentions?
> Though most software I install goes in /usr/local by default!

> Are Klaus and Rodrick's suggestions along the lines of what Scott
> refers to as creating a "whole-root" non-global zone? I'd like to save
> disk space, and keep packages more or less in-sync across zones, so
> maybe sharing as much as possible is still better for me?

If lots of you software installs in /usr/local/bin and you want to
share that from the global to all local zones, but you want to be
able have separate configs per zone, I'd try to make a filesystem/slice
in each zone for /usr/local/etc. So the software installs in
/usr/local/bin and is shared because /usr is inherited, but to configs
are in /usr/local/etc which is a separate filesystem in each zone.

HTH, Erik.

 
 
 

Configuring packages from zone to zone

Post by Thomas Muder » Wed, 16 Mar 2005 20:01:04


hello,


> Thanks for the responses - this group is great.

> If I'd made /usr/local its own slice - would I have avoided this? Or is
> the shared /usr fs recursive across slices?

> If /usr/local were it's own slice, would I even see it in my non-global
> zones?
> Would it be writeable per zone? If not, is there a way to make it so,
> like /etc is?

/usr/local doesn't have to be its own slice in the global zone. It would
not even affect the sharing in the non-global zones. Instead, do
something like the following, which is also mentionend in the docs
(hint, hint....):

add fs
set dir=/usr/local
set special=/data/zlocal/sisx1
set type=lofs
end

This mounts the global zone directory /data/zlocal/sisx1 as /usr/local
in the non-global zone. You could of course use an extra slice for the
non-global zone too, as you want.

Quote:> Maybe it's better to install from source, installing to writable
> locations,  or use packages which follow the convention Scott mentions?
> Though most software I install goes in /usr/local by default!

that's possible, too.

Quote:> Are Klaus and Rodrick's suggestions along the lines of what Scott
> refers to as creating a "whole-root" non-global zone? I'd like to save
> disk space, and keep packages more or less in-sync across zones, so
> maybe sharing as much as possible is still better for me?

For saving disk space, do what I suggested. It works well. Also consider
reading the appropriate docs on docs.sun.com.

regards
        Thomas

 
 
 

1. zones - problem with configuring another, new zone

Hello,

sparc Solaris 10 3/05 + Recommended patches. We have configured three
local zones and are configuring right now fourth zone. After installing
and connecting to the zone console (zlogin -C ...) while configuring
network:

  Host Name for hme0:4                                                          

  Enter the host name which identifies this system on the network.  The name
  must be unique within your domain; creating a duplicate host name will cause
  problems on the network after you install Solaris.

  A host name must be at least two characters; it can contain letters, digits,
  and minus signs (-).

    Host name for hme0:4 3000                            

    Esc-2_Continue    Esc-6_Help

 we get:

  Confirm Information for hme0:4                                                

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.

    Networked: Yes
    Host name: 3000

  Just a moment...

Assertion failed: have_min_net_info(nc) == TRUE, file main.c, line 1468

Below is configuration for the zone:
bash-3.00# zonecfg -z 3000
zonecfg:3000> info
zonepath: /zones/3000
autoboot: true
pool:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /usr
inherit-pkg-dir:
        dir: /sbin
fs:
        dir: /usr/local
        special: /zones/local/3000
        raw not specified
        type: lofs
        options: [rw]
net:
        address: 192.168.220.252/24
        physical: hme0
zonecfg:3000>

Does anybody know what is wrong ?

przemol

2. Doom question/problem...

3. Creating a "zone" from another "zone" (from another "zone" (from another "zone" )) ...

4. Netscape FAQ

5. Advice sought: global zone pkgs vs. local zone pkgs

6. help with tcl7.5 tk4.1

7. Zones within a Zone?

8. ssh - password authentication failed

9. zone file for single IP zone?

10. BIND forwarding zone / Proxy zone? How?

11. Solaris 10 zones - communication between zones

12. Why are some packages installed in all zones for Solaris 10, but some packages are not ?

13. Packages and Zones