Prefetch Technologies // Keeping your cache lines cozy

Cleaning up failed package installations

While attempting to install a Sun package this week, I encountered the following error:

$ pkgadd -d . MYpackage
## Waiting for up to <300> seconds for package administration
commands to become available (another user is administering packages on
zone `zoneA`)

^C

1 package was not processed!

After a bit of truss'ing, I noticed that the pkgadd commands were checking for the existence of files with the name .ai.pkg.zone.lock.DYNAMICALLY_GENERATED_STRING in /tmp. Based on a cursory inspection of the package utility source code, it appears these files are used as lock files to prevent multiple package commands from running at the same time. Since this was the only package installation running on the system, I logged into the zone and removed the stale lock file:

$ zlogin zoneA
$ rm /tmp/.ai.pkg.zone.lock-afdb66cf-1dd1-11b2-a049-000d560ddc3e

Once I removed this file, the package installed like a champ! Nice!