Behaviour of SVR4 packages in Zones

This page is intended to be a semi-permenant place to record the behaviour of pkgadd and pkgrm in zones.

The following tables record observed behaviour of the assorted script types, for each possible deployment style of /opt/csw in a zone.

Behaviours tested and observed, on:

Solaris 10 10/09 s10s_u8wos_08a SPARC

Consistent in ALL types:

pkgadd step-by-step from global zone (without -G)

  • always creates $ZONEROOT/var/sadm/pkg/SOMEpkg
  • always updates the zone-local /var/sadm/install/contents, with the actual file contents

Steps that pkgadd follows:

  1. prompts about running scripts, if needed, in non-global zones
  2. prompts about running scripts, if needed, in global zone
  3. runs preinstall in global zone
  4. installs "class none" files in global zone
  5. "verifies" class none
  6. runs "class XYZ" scripts in global zone
  7. "verifies" class XYZ
  8. runs postinstall script in global zone

Then for each child zone -

  1. runs preinstall
  2. "verifies" class none
  3. runs "class XYZ" action scripts for the zone
  4. "verifies" the class
  5. runs postinstall

(and then loops through all the other zones)

pkgrm step by step in the global zone,

(could use more details like pkgadd, above)

  • processes all child zones first, then handles global

** This includes running all "class" removal scripts in the child zones, before running the processing in the global zone.

Complicated problem #1: Unexpected removal of package from non-global zone

(The following presumes /opt/csw is NOT an inherit-pkg-dir)

  1. pkgadd some package in the global zone
  2. pkgrm from non-global zone, then pkgadd newer(or some alternative) version
  3. pkgrm original package from global zone. *Will remove other version from non-global zone also!*

This may be okay for you, if purpose of pkgrm is in preparation of installing the latest version for the global zone and all other zones. Or, it may not be okay for you.

Complicated problem #2: Unexpected conflict of package in non-global zone

  1. pkgadd in non-global zone, some specific version of a package
  2. Later, pkgadd in global zone, some potentially newer version of a package.
  3. pkgadd will complain about "unique instance" of package being required. But if you tell it to, it will continue…
  4. pkgadd will then install newer version of package in all zones except original non-global zone, which retains original version.

(and if you have your global-zone installs done in some "always answer yes" mode, you may never even notice that one zone is out of date)

Dir type: inherit-pkg-dir

Action: pkgadd in global zone

Script type Behaviour
preinstall cell-content
postinstall cell-content
i.class Always called, but does not get passed any list of files in the "inherited" directory, to stdin
r.class N/A

Action: pkgrm in global zone

Script type Behaviour
i.class N/A
r.class Always called, but does not get passed any list of files in the "inherited" directory, to stdin

Dir type: regular, part of normal /

Action: pkgadd in global zone

Script type Behaviour
preinstall cell-content
postinstall cell-content
i.class Always called, and gets passed copies of the files in the class
r.class cell-content

Action: pkgrm in global zone

Script type Behaviour
i.class N/A
r.class Always called, and gets passed copies of the files in the class

Dir type: read-only lofs, but NOT inherit-pkg-dir

Action: pkgadd in global zone

Script type Behaviour
preinstall cell-content
postinstall cell-content
i.class Seems to act identically to inherit-pkg-dir
r.class cell-content

Action: pkgrm in global zone

Script type Behaviour
i.class N/A
r.class Always called, and gets passed copies of the files in the class

Oddly, calling removef in the class script, does not trigger an error. However, the "regular" (class 'none') files, DO trigger a failure in child zone. pkgadd is smart enough to figure out "file is already there, so ignore". Yet pkgrm is not smart enough to figure out "it's read-only from global, so ignore error of rm" ??

zlogin /zonename/ pkgrm SOMEpkg cleans up the excess baggage.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License