Showing posts with label ips. Show all posts
Showing posts with label ips. Show all posts

Monday, January 03, 2011

pkg(1) and local caching of downloads

When installing packages, the pkg(1) command, by default, caches the downloaded files under the /var/pkg directory.

If you're using IPS to install packages from local repositories (either over the network or from the filesystem) you probably don't want to store an additional copy of files you could easily obtain again.

The caching behaviour is controlled by the local image property "flush-content-cache-on-success". Setting it to "true" will cause the cache to be emptied when packages are installed successfully:

boyd@sol11:~$ pkg property flush-content-cache-on-success
PROPERTY VALUE
flush-content-cache-on-success False
boyd@sol11:~$ sudo pkg set-property flush-content-cache-on-success true
boyd@sol11:~$ pkg property flush-content-cache-on-success
PROPERTY VALUE
flush-content-cache-on-success True

Now, after a successful package install, the cached files that were kept around from older installs are removed:

boyd@sol11:~$ sudo pkg install desktop/synergy
Packages to install: 1
Create boot environment: No
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 27/27 6.7/6.7

PHASE ACTIONS
Install Phase 56/56

PHASE ITEMS
Package State Update Phase 1/1
Image State Update Phase 2/2

PHASE ITEMS
Reading Existing Index 8/8
Indexing Packages 1/1
Deleting content cache

Monday, December 27, 2010

IPS file based repositories and zones

If you are using filesystem based (file://) repositories with IPS, rather than network-based ones, there is one caveat to worry about when making zones.

When a zone is created on Solaris 11, the set of repos to use is copied from the global zone. If you're using network-based repositories this is normally not a problem. There could still be an issue if you use "localhost" in your repo URLs, or the non-global zone does not have access to the network repos that the global zone does.

With filesystem-based repositories, however, the non-global zone almost certainly doesn't have access to the appropriate directories by default.

For example:
root@global# pkg publisher
PUBLISHER TYPE STATUS URI
solaris (preferred) origin online http://localhost/
boyd origin online file:/export/repo/boyd/
root@global# zoneadm -z cal install
A ZFS file system has been created for this zone.
Publisher: Using solaris (http://localhost/ ).
Publisher: Using boyd (file:/export/repo/boyd/).
[...]


root@cal:~# pkg refresh
pkg: 0/2 catalogs successfully updated:
Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
[...]
2: file protocol error: code: 22 reason: The path '/export/repo/boyd' does not contain a valid package repository.
Repository URL: 'file:/export/repo/boyd'.

One way to deal with this is to loopback mount (read-only) the repo directory into the zone:

root@global# zonecfg -z cal
zonecfg:cal> add fs
zonecfg:cal:fs> set special=/export/repo/boyd
zonecfg:cal:fs> set dir=/export/repo/boyd
zonecfg:cal:fs> set type=lofs
zonecfg:cal:fs> add options ro
zonecfg:cal:fs> end
zonecfg:cal> exit

Now the zone can access the repo as it should.

Monday, December 20, 2010

IPS slides from MSOSUG December meeting

Another great turnout last week for the last MSOSUG meeting of the decade.

Andre talked on the Automated Installer (AI) for Solaris 11, while I talked about some of the lesser known parts of IPS (Choose File -> Download Original for a PDF).

There are a few points I didn't have time to cover that I'll try to mention over the next few weeks.

Hope these slides help.