Showing posts with label pkgadd. Show all posts
Showing posts with label pkgadd. Show all posts

Tuesday, February 8, 2011

Comparing Packages Between Platforms


Comparing Packages Beteen Plataforms

Abstract:
When working in a clustered environment, it is often a requirement to see if the appropriate packages have been installed on all platforms in the cluster. The number of packages on a platform are many, but a simple script can be helpful.

Packaging Technology:
The industry standard packaging for UNIX systems is UNIX SVR4 packaging. Standard tools for packaging include: pkgadd, pkginfo, pkgtrans, pkgrm, pkgmk, pkgchk, pkgparam, pkgproto, pkgadm.

A long utput from the pkginfo command follows:

sun9/user$ pkginfo -l HPNP                                             

PKGINST: HPNP
NAME: JetAdmin for Unix
CATEGORY: application
ARCH: sparc
VERSION: D.06.15
BASEDIR: /
VENDOR: HP
DESC: HP Network Printer support package
PSTAMP: odybld3981208144215
INSTDATE: Aug 12 2005 08:50
STATUS: completely installed
FILES: 348 installed pathnames
6 shared pathnames
32 directories
238 executables
13353 blocks used (approx)



For a cursory view of a system, the pkginfo command provides basic information required for cursory consistency checks.

Simple Check:
If the identical install media is used, a simple post-install check may be desired across multiple platforms in a cluster. An sample script follows where sun1, sun2, sun3, sun4 are located on a network where temporary directories are shared via NFS and automounting is enabled.

sun1/user$ pkginfo >/net/sun4/tmp/sun1.packages
sun2/user$ pkginfo >/net/sun4/tmp/sun2.packages
sun3/user$ pkginfo >/net/sun4/tmp/sun3.packages
sun4/user$ cd /tmp

sun4/user$ nawk ' BEGIN { Pattern="%35s%35s%35s%35s\n" }
FILENAME=="sun1.packages" { sun1[$2]=$2 ; Name[$2]=$2 }
FILENAME=="sun2.packages" { sun2[$2]=$2 ; Name[$2]=$2 }
FILENAME=="sun3.packages" { sun3[$2]=$2 ; Name[$2]=$2 }
END {
printf Pattern,"Common","sun1","sun2","sun3"
for ( i in Name ) printf Pattern,i,sun1[i],sun2[i],sun3[i]
}' *.packages sort nawk 'NF<4'
A simple output of 4 columns is produced, with differences.

   SMCdb       SMCdb     SMCdb                      
SMCtk SMCtk SMCtk
SFWatk SFWatk SFWatk
SMCgcc SMCgcc SMCgcc
SMCtcl SMCtcl SMCtcl
SMCxpm SMCxpm SMCxpm
SUNWdc SUNWdc SUNWdc
SUNWus SUNWus
TSIpgx TSIpgx
SFWdbus SFWdbus SFWdbus
SFWgtk2 SFWgtk2 SFWgtk2
SMCgdbm SMCgdbm SMCgdbm
SMCntop SMCntop SMCntop
SMCossl SMCossl SMCossl
SMCpcre SMCpcre SMCpcre
SMCrrdt SMCrrdt SMCrrdt
SMEvplr SMEvplr
SMEvplu SMEvplu
SUNWaac SUNWaac
SUNWafb SUNWafb
SUNWbdb SUNWbdb
...
Versioning and Integrity Checks:

In order to test for proper versions and package integrity, there are other commands which can be leveraged:
  • pkgchk
    Check detailed integrity of files associated with packages, including existence, permissions, etc.
  • pkginfo -l
    Check versioning, architecture, dates, install integrity, etc.
The package checking script can be enhanced with such scripts for more robust checking.

Saturday, December 5, 2009

Solaris 10: Adding Contributed Software

Solaris 10: Adding Contributed Software

Abstract:
Solaris 10 is an operating system based upon open source software and AT&T System V software. Other open sourced software has traditionally been available. Sun had started the process of bundling open software on a separate companion disk with their operating system.

Process:

The first step of this series, is to install the Solaris 10 operating system.

Insert the Companion CD into the CD-ROM drive on the server, the Volume Manager (vold) will automatically mount the CD-ROM.
Ultra2/root# df -h
Filesystem size used avail capacity Mounted on
...
/vol/dev/dsk/c0t6d0/s10_1009_software_companion
649M 649M 0K 100% /cdrom/s10_1009_software_companion

The Companion CD bundles the source code, proprietary Intel object code, and open SPARC object code packages.

Ultra2/root# cd /cdrom/s10_1009_software_companion/Solaris_Software_Companion
Ultra2/root$ ls -alid Solaris*/Packages
36096 drwxr-xr-x 110 root sys 16384 Aug 27 18:16 Solaris_i386/Packages
4352 drwxr-xr-x 110 root sys 16384 Aug 27 18:16 Solaris_sparc/Packages

The instructions for automatically installing all of the Companion packages are located in the following README file

Ultra2/root# cd /cdrom/s10_1009_software_companion
Ultra2/root# ls -al README
-rw-r--r-- 1 root sys 2619 Aug 27 18:16 README
To install all the packages, use AT&T System V packaging command "pkgadd" for the architecture the system which is being installed under (i.e. sun4u is sparc).

One can pick the packages they want to install, but since there are many prerequisites, this is probably not the wisest way. One should always sit there, the first time they do this in their lives, and press "y" about 100 times, during the install process, reading everything that goes by, so they understand what they are installing.
Ultra2/root# cd /cdrom/s10_1009_software_companion/Solaris_Software_Companion
Ultra2/root# pkgadd -d Solaris_sparc/Packages all
...
Do you want to continue with the installation of <various package> [y,n,?] y
...

After doing several installs, one should automate the process. The README file describes a process to build some install defaults in "/var/tmp/admin" and allow "pkgadd" to just perform the installs automatically. The instructions below use a "here document" in shell, in order to remove the requirement of a user typing this information in manually.
Ultra2/root# cat >/var/tmp/admin <<!
mail=
conflict=nocheck
setuid=nocheck
action=nocheck
partial=nocheck
instance=overwrite
idepend=nocheck
rdepend=nocheck
space=check
!


Ultra2/root# cd /cdrom/s10_1009_software_companion/Solaris_Software_Companion

Ultra2/root# pkgadd -a /var/tmp/admin -d $PWD 



After adding the packages, one should patch Solaris with the latest fixes.