Previous section.

Systems Management: Distributed Software Administration
Copyright © 1997 The Open Group

Sample File Coding

Defaults File

The following is an example defaults file:

# File:        /var/adm/sw/defaults
# Description: This file contains example system defaults

swinstall.allow_downdate =false
swinstall.allow_incompatible =false
swinstall.ask =false
swinstall.autoreboot =false
swinstall.autoselect_dependencies =true
swinstall.defer_configure =false
swinstall.distribution_source_directory =/var/spool/sw
swinstall.enforce_dependencies =true
swinstall.enforce_dsa =true
swinstall.enforce_locatable =true
swinstall.enforce_scripts =true
swinstall.installed_software_catalog =/var/adm/sw/catalog
swinstall.logfile =/var/adm/sw/swinstall.log
swinstall.loglevel =1
swinstall.reinstall =false
swinstall.select_local =true
swinstall.software
swinstall.targets
swinstall.verbose =1
   
swcopy.autoselect_dependencies =true
swcopy.distribution_source_directory =/var/spool/sw
swcopy.distribution_target_directory =/var/spool/sw
swcopy.enforce_dependencies =true
swcopy.enforce_dsa =true
swcopy.logfile =/var/adm/sw/swcopy.log
swcopy.loglevel =1
swcopy.recopy =false
swcopy.select_local =true
swcopy.software
swcopy.targets
swcopy.verbose =1
   
swremove.autoselect_dependents =false
swremove.distribution_target_directory =/var/spool/sw
swremove.enforce_dependencies =true
swremove.enforce_scripts =true
swremove.installed_software_catalog =/var/adm/sw/catalog
swremove.logfile =/var/adm/sw/swremove.log
swremove.loglevel =1
swremove.select_local =true
swremove.software
swremove.targets
swremove.verbose =1
   
swconfig.allow_incompatible =false
swconfig.allow_multiple_versions =false
swconfig.ask =false
swconfig.autoselect_dependencies =true
swconfig.autoselect_dependents =false
swconfig.enforce_dependencies =true
swconfig.installed_software_catalog =/var/adm/sw/catalog
swconfig.logfile =/var/adm/sw/swconfig.log
swconfig.loglevel =1
swconfig.reconfigure =false
swconfig.select_local =true
swconfig.software
swconfig.targets
swconfig.verbose =1
   
swask.autoselect_dependencies =true
swask.distribution_source_directory =/var/spool/sw
swask.distribution_source_serial =/dev/rmt/dat
swask.logfile =/var/adm/sw/swask.log
swask.loglevel =1
swask.software
swask.targets
swask.verbose =1
   
swmodify.distribution_target_directory =/var/spool/sw
swmodify.installed_software_catalog =/var/adm/sw/catalog
swmodify.files
swmodify.logfile =/var/adm/sw/swmodify.log
swmodify.loglevel =1
swmodify.select_local =true
swmodify.software
swmodify.targets
swmodify.verbose =1
   
swverify.allow_incompatible =false
swverify.autoselect_dependencies =true
swverify.check_contents =true
swverify.check_permissions =true
swverify.check_requisites =true
swverify.check_scripts =true
swverify.check_volatile =false
swverify.distribution_target_directory =/var/spool/sw
swverify.enforce_dependencies =true
swverify.enforce_locatable =true
swverify.installed_software_catalog =/var/adm/sw/catalog
swverify.logfile =/var/adm/sw/swverify.log
swverify.loglevel =1
swverify.select_local =true
swverify.software
swverify.targets
swverify.verbose =1
   
swlist.distribution_target_directory =/var/spool/sw
swlist.installed_software_catalog =/var/adm/sw/catalog
swlist.one_liner =revision title
swlist.select_local =true
swlist.software
swlist.targets
   
swpackage.distribution_target_directory =/var/spool/sw
swpackage.distribution_target_serial =/dev/rmt/dat
swpackage.enforce_dsa =true
swpackage.follow_symlinks =false
swpackage.logfile =/var/adm/sw/swpackage.log
swpackage.loglevel =1
swpackage.media_capacity =1330
swpackage.media_type =directory
swpackage.psf_source_file =psf
swpackage.software
swpackage.verbose =1

Product Specification File

The following is an example product specification file:

# File:        psf.posix
# Description: This illustrates the structure of a typical application
#              software product.
distribution
# Vendor definition
    vendor
        tag              FineSoft
        title            Fine Software Corporation
         description     "Fine Software Corporation
                          1233 Technology Way
                          Sunset Bay, Ca, 90456
                          1-800-555-1231"
# Bundle definition:
    bundle
        tag              POSIX-SM
        title            POSIX 1387 System Management 
        revision         1.0
        vendor_tag       FineSoft
        contents         POSIX-Printer,r=4.0 POSIX-Software,r=2.0
        contents         POSIX-User,r=1.0

# Product definition:
    product
        tag              POSIX-Software
        title            POSIX 1387.2 Software Administration Utilities
        revision         2.0
        vendor_tag       FineSoft
        number           J2326AA
        description      < /build/data/description
        copyright        < /build/data/copyright
        machine_type     9000/[78]*
        os_name          HP-UX
        os_release       ?.09.*
        os_version       ?
        directory        /

    # Subproduct definitions:
        subproduct
            tag          Manager
            title        management utilities
            contents     commands agent man
        subproduct
            tag          Agent
            title        target daemon and agent
            contents     agent man

    # Fileset definitions:
        fileset
            tag          commands
            title        Commands (management utilities)
            configure    scripts/configure.data
            prerequisite POSIX-Software.agent
            directory    /build/usr/sbin /usr/sbin/
            file         swinstall
            file         swconfig
            file         swcopy
            file         swlist
            file         swremove
            file         swverify
            file         swpackage


        fileset
            tag          agent
            title        Agent (target agent)
            configure    /build/system/SD-AGENT/customize
            unconfigure  /build/system/SD-AGENT/decustomize
            file         /build/usr/sbin/swagentd /usr/sbin/swagentd
            file         /build/usr/lbin/swagent /usr/lbin/swagent

        fileset
            tag          man
            title        Manual (man pages)
            directory    /build/usr/man/man8 /usr/man/man8
            file         swinstall.8
            file         swcopy.8
            file         swremove.8
            file         swlist.8
            file         swverify.8
            file         swconfig.8
            file         swpackage.8
            file         swagent.8
            file         swagentd.8
            directory    /build/usr/man/man4 /usr/man/man4
            file         swpackage.4

Software Packaging Layout

The following is an example software packaging layout created from the PSF in Product Specification File , for a distribution located at /var/spool/sw/:

catalog
catalog/INDEX
catalog/dfiles
catalog/dfiles/INDEX
catalog/dfiles/INFO
catalog/POSIX-Software
catalog/POSIX-Software/pfiles
catalog/POSIX-Software/pfiles/INFO
catalog/POSIX-Software/agent
catalog/POSIX-Software/agent/INFO
catalog/POSIX-Software/agent/configure
catalog/POSIX-Software/agent/unconfigure
catalog/POSIX-Software/commands
catalog/POSIX-Software/commands/INFO
catalog/POSIX-Software/commands/configure
catalog/POSIX-Software/man
catalog/POSIX-Software/man/INFO
POSIX-Software
POSIX-Software/agent
POSIX-Software/agent/usr
POSIX-Software/agent/usr/lbin
POSIX-Software/agent/usr/lbin/swagent
POSIX-Software/agent/usr/sbin
POSIX-Software/agent/usr/sbin/swagentd
POSIX-Software/commands
POSIX-Software/commands/usr
POSIX-Software/commands/usr/sbin
POSIX-Software/commands/usr/sbin/swinstall
POSIX-Software/commands/usr/sbin/swpackage
POSIX-Software/man
POSIX-Software/man/usr
POSIX-Software/man/usr/man
POSIX-Software/man/usr/man/man4
POSIX-Software/man/usr/man/man4/swpackage.4
POSIX-Software/man/usr/man/man8
POSIX-Software/man/usr/man/man8/swagent.8
POSIX-Software/man/usr/man/man8/swagentd.8
POSIX-Software/man/usr/man/man8/swconfig.8
POSIX-Software/man/usr/man/man8/swcopy.8
POSIX-Software/man/usr/man/man8/swinstall.8
POSIX-Software/man/usr/man/man8/swlist.8
POSIX-Software/man/usr/man/man8/swpackage.8
POSIX-Software/man/usr/man/man8/swremove.8
POSIX-Software/man/usr/man/man8/swverify.8

INDEX File

The following is an example INDEX file for the software packaging layout in Software Packaging Layout .

distribution
    layout_version 1.0
    uuid 944B41Z-X135
media
    sequence_number 1
vendor
    tag FineSoft
    title Fine Software Corporation
    description "Fine Software Corporation
                 1233 Technology Way
                 Sunset Bay, Ca, 90456
                 1-800-555-1231"
bundle
    tag POSIX-SM
    title POSIX 1387 System Management 
    revision 1.0
    vendor_tag FineSoft
    contents POSIX-Printer,r=4.0 POSIX-Software,r=2.0 POSIX-User,r=1.0
product
    tag POSIX-Software
    instance_id 1
    control_directory POSIX-Software
    revision 2.0
    vendor_tag FineSoft
    title POSIX 1387.2 Software Administration Utilities
    description "The objective of this standard is to address this 
    problem for software administration, a specific area of system 
    administration, and to contribute to the overall solution of 
    administering computing environments, both stand-alone and 
    distributed.

    In pursuit of this goal, this standard defines a set of utilities,
    a set of objects acted upon by those utilities, a set of information
    maintained about installed software, and the layout on a physical
    medium of software awaiting installation.
    These definitions provide the flexibility necessary for system
    administrators to enforce policies suitable to their environments."
    directory /
    machine_type 9000/[78]    
    os_name HP-UX
    os_release ?.09.    
    os_version ?
    all_filesets agent commands man
    number J2326AA
    copyright <copyright
subproduct
    tag Agent
    title target daemon and agent
    contents agent man 
subproduct
    tag Manager
    title management utilities
    contents commands agent man 
fileset
    tag agent
    control_directory agent
    size 5333089
    title Agent (target agent)
    state available
fileset
    tag commands
    control_directory commands
    size 8531074
    title Commands (management utilities)
    state available
    prerequisite POSIX-Software.agent
fileset
    tag man
    control_directory man
    size 162749
    title Manual (man pages)
    state available

INFO File

The following is an example INFO file for the software packaging layout in Software Packaging Layout , and the INDEX file in INDEX File .

control_file
    path INFO
    size 638
    tag INFO
control_file
    path configure
    size 3023
    tag configure
control_file
    path unconfigure
    size 375
    tag unconfigure
file
    path /usr/lbin/swagent
    type f
    size 2973696
    cksum 3139283961
    mode 0555
    uid 0
    gid 3
    owner root
    group sys
    mtime 739080771
file
    path /usr/sbin/swagentd
    type f
    size 2355200
    cksum 1313249400
    mode 0555
    uid 0
    gid 3
    owner root
    group sys
    mtime 739081332

Control Script

The following is an example control script for the software packaging layout in Software Packaging Layout , the INDEX file in INDEX File , and the INFO file in INFO File .

#
# agent configure script
#
PATH=$SW_PATH
ROOT=$SW_ROOT_DIRECTORY
BASE_DIR=$ROOT/$SW_LOCATION
MY_CATALOG=$SW_ID
MY_CONTROL_DIR=$SW_CONTROL_DIRECTORY
MY_SCRIPT=$SW_CONTROL_TAG
OPTIONS=$SW_SESSION_OPTIONS

# Make sure /var/adm/sw/ exists
if [ ! -d $BASE_DIR/var/adm/sw ]
then
    mkdir -p $BASE_DIR/var/adm/sw
    chmod 555 $BASE_DIR/var/adm/sw
fi

# Make sure we are running on "/" (swconfig should enforce this)
if [ $ROOT != "/" ]
then
    # Exit error
    echo "ERROR:   Trying to run $MY_SCRIPT when root is not /."
    exit 1
fi

# Kill and restart the daemon
daemon_process="`ps -e|grep swagentd|grep -v grep|awk '{print $1}'`"
if [ "${daemon_process}" != "" ]
then
    kill $daemon_process
    if [ $? != 0 ]
    then
        # Exit warning
        echo "WARNING: Can not kill and restart the daemon."
        exit 2
    fi
fi
/usr/sbin/swagentd

# Exit success
exit 0

Patch PSF Example

product
    tag             OS-Core
    revision        B.10.01.006
    architecture    HP-UX_B.10.01_700
    vendor_tag      HP

    title           Core Operating System (patch)

    machine_type    9000/7??
    os_name         HP-UX
    os_release      ?.10.0*
    os_version      *

    is_patch        true

    category_tag    critical


    fileset
        tag CMDS-MIN
        title "Patch of csh and who"
        description " Patch of csh and who ... blah blah blah."

        # assume that other patches to base fileset used up 004 and 005
        revision B.10.01.006

        ancestor OS-Core.CMDS-MIN,r=B.10.01,a=HP-UX_B.10.01_700,v=hp

        is_patch     true      # this is a patch/sparse fileset
        supersedes OS-Core.CMDS-MIN,r=B.10.01.002
        supersedes OS-Core.CMDS-MIN,r=B.10.01.003

        file /build2/usr/bin/csh  /usr/bin/csh
        file /build/sbin/who      /sbin/who
    end
end


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index