Thursday, October 25, 2012

Solaris 11.1 availability

Today is a great day!
Solaris 11.1 is available for downloading!
 
The new update continues raising the bar.
Tremendous enhancements and new features.
Oracle is definitely sustaining Solaris as the best UNIX™ ever.
  
Once more, since the beginning of this blog I can say:
If it must run, it runs on Solaris!
    
For the record, coincidence or not, Windows 8 became available today as well.
Unfortunately I didn't feel inclined to its new interface for desktop computing.
But that's another story that fortunately has nothing to do with Solaris.
 

Solaris 10 parallel zone patching

By a zoned Solaris 10 system I mean the existence of many non-global zones (NGZ).
There's perhaps a less known tunning that allows for parallel updating of multiple zones.
     
The num_proc setting is at /etc/patch/pdo.conf and described at pdo.conf(4).
The recommendation is to have num_proc equal to the on-line CPUs.
  
Thus, on a system with 4 online CPUs:
  
# psrinfo
0       on-line   since 10/18/2012 06:28:18
1       on-line   since 10/18/2012 06:28:18
2       on-line   since 10/18/2012 06:28:18
3       on-line   since 10/18/2012 06:28:18
 
A setting of 4 is recommended:
 
# cp -p /etc/patch/pdo.conf{,.0}
# vim /etc/patch/pdo.conf
# grep num_proc= /etc/patch/pdo.conf

# num_proc=
# num_proc=1 # default entry
num_proc=4
    

Wednesday, October 3, 2012

Unattended SVr4 package install

SVr4 relocatable and non-relocatable packages add/removal can be fully automated.
This is accomplished by CLI options for response and administration files.
For simplicity, assume /pkg/out as the current directory on all that follows.
   
# cd /pkg/out
    
A response file is required if the package uses an interactive request script.
If so, the pkgask command is used to record all the answers in this file.
That's the case with my sample relocatable package PHXapp1.
    
# pkgask -r ./PHXapp1.response -d ./PHXapp1.pkg PHXapp1 all
Processing package instance <PHXapp1> from </pkg/out/PHXapp1.pkg>
Relocatable sample package(i386,sparc) 1.0
Copyright (c) 2012 ...
Enter path to package base directory (q to quit) [/opt/PHXapp1] <ENTER>
Response file </pkg/out/PHXapp1.response> was created.
Processing of request script was successful.
   
# cat PHXapp1.response
BASEDIR=/opt/PHXapp1
   
Otherwise the following error message appears explaining the situation.
That's the case for my sample non-relocatable SMF service package PHXsvc1:
   
# pkgask -r ./PHXsvc1.response -d ./PHXsvc1.pkg PHXsvc1
pkgask: ERROR: ... does not contain an interactive request script
      
In general an administration file, admin(4), is required.
This is specially required if the package contains or references other scripts.
Basically and at a minimum, the following entries seem enough:
   
# cat PHX.admin
setuid=nocheck
action=nocheck
  
The above files make unattended package operations possible.

Option -r is for specifying the response file to pkgadd.
Option -a is for specifying the administration file to both pkgadd and pkgrm.
Optionally, the listing of the package contents can be omitted with option -n.

For the sample non-relocatable SMF service package PHXsvc1 it looks like:

# pkgadd -n -a ./PHX.admin -d ./PHXsvc1.pkg all
Copyright (c) 2012 ...
Installation of <PHXsvc1> was successful.

# pkgrm -n -a ./PHX.admin PHXsvc1
Waiting up to 30 seconds for svc:/site/phx-svc:default to stop...
Removal of <PHXsvc1> was successful.

For the sample relocatable application package PHXapp1 it looks like:

# pkgadd
  -n
  -a ./PHX.admin
  -r ./PHXapp1.response
  -d ./PHXapp1.pkg
  all
Copyright (c) 2012 ... 
Installation of <PHXapp1> was successful.

# pkgrm -n -a ./PHX.admin PHXapp1
Removing package base directory.
Removal of <PHXapp1> was successful.