Enda O'Connor ( Sun Micro Systems Ireland) wrote:
> Fat Ted wrote:
>> Hi,
>>
>> Is it possible to create a sparse root zone from within a package's 
>> postinstall script?
>> I've created a package; and via the postinstall script, I want to create a 
>> basic sparse root zone. Despite the postinstall script working fine as a 
>> stand alone script (creates zone no problemo), it fails as a "postinstall" 
>> script during a pkgadd...
>>
>> Error comes out as (from zoneadm ... install):
>>
>> ERROR: Unable to acquire zone administration lock for this system; please 
>> try again later
>> ERROR: cannot create zone boot environment
>> zoneadm: zone 'bose-zone': '/usr/lib/lu/lucreatezone' failed with exit code 
>> 94.
>>
>> (I've tried deleting the /tmp/.ai.pkg.zone.lock-xxx... file, and the zone 
>> partially installs, but gives errors for just about every package: 
>> "Installation of these packages generated errors: <SMCphp FJSVvplr 
>> FJSVvplu SUNWcakr SUNWcar SUNWkvm FJSVhea SUNWjdmk-base SUNWckr SUNWcnetr 
>> SUNWcsl SUNWcsr SUNWcsu... and about another 600 :)".
>> If you then try and boot, the zone mounts (STATUS = mounted, which was a new 
>> one for me, [i]zoneadm -z zone unmount[/i] to cancel this:))
>>
>> Any hot tips?
>>

Since what you're attempting won't work, as Enda described, here's another 
idea - which may or may not work for your situation.

1) create a zone on a system
2) add the package to it
3) clone the zone
4) detach the clone
5) copy the detached zone to any system which needs the package and zone
6) attach the zone to those systems

>> This message posted from opensolaris.org
>> _______________________________________________
>> zones-discuss mailing list
>> zones-discuss@opensolaris.org
> Hi
> Basically zoneadm install cannot run if pkgadd itself is running in the 
> global for the package you are installing, as the package is locked down 
> until we finish.
> 
> Why are you doing this in a package postinstall script?
> Doesn't seem like a suitable place for this kind of work at all, 
> basically postinstall is ideally meant to finalise the package install 
> for the particular package being installed, not for doing other sysadmin 
> work such as creating zones.
> 
> Basically even if this worked, and assuming we waited till the zone got 
> created before exiting postinstall, pkgadd would run for perhaps half 
> hour depending, which would not be good.
> 
> Enda
> _______________________________________________
> zones-discuss mailing list
> zones-discuss@opensolaris.org

-- 
--------------------------------------------------------------------------
Jeff VICTOR              Sun Microsystems            jeff.victor @ sun.com
OS Ambassador            Sr. Technical Specialist
Solaris 10 Zones FAQ:    http://www.opensolaris.org/os/community/zones/faq
--------------------------------------------------------------------------
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to