James Carlson wrote:
> Why is this on zones-discuss-confidential?  I don't see anything
> confidential here.  Please use the main list.
> Ritu Agrawal writes:
>> We're running into some problems when we run zonename in an alternate 
>> root. The following error messages are seen :
>> zonename: fatal: version `SUNW_1.22' not found 
>> (required by file /altroot.5.10/sbin/zonename)
>> zonename: fatal: open failed: No such file or directory
> It looks to me like you're trying to run a binary that's inside an
> alternate root itself, and that Zones really has nothing to do with
> the problem.
> Binaries in alternate root environments cannot be guaranteed to work.
> They depend in undocumented ways on libraries found in the alternate
> environment, and those libraries in turn depend on the kernel itself
> in undocumented ways.
> Use /sbin/zonename and you should be fine

This is a Live upgrade case when we are on the alternate root. The 
alternate root has the O/S installed and we try to upgrade some of our 
packages.  Please note that this is all happening in the alternate root. 
We attempt to do a pkgadd -d <dir> -R <altroot> <pkgname>. The 
package/postinstall inturn does a zonename first. Since we are in the 
alternate root, the command thats run is <altroot>/usr/bin/zonename 
which is when it fails.

Here's a code snippet :


# detect whether we are running in a global or non-global zone
if [ "${SUNW_PKG_INSTALL_ZONENAME}" = "" ] ; then
        if [ -x ${ZONECMD} ]; then                                  
<==========================FAILS HERE since the command thats run is 

                if [ "`${ZONECMD}`" != "global" ]; then
        if [ "${SUNW_PKG_INSTALL_ZONENAME}" != "global" ] ; then

# If installing into a non-global zone, simply exit
if [ ${IS_NONGLOBAL} -eq 1 ] ; then
        exit 0

> .
>> Is this the expected behavior ? The problem shows up when we attempt a 
>> Live Upgrade and one of the postinstall script attempts to run 
>> "zonename" in the alternate root.
> Why isn't it using /sbin/zonename?

zones-discuss mailing list

Reply via email to