As the final step in software stack deployment, Change Manager runs the finish scripts contained in the Solaris Flash archive. Change Manager provides a driver script that executes all user-supplied finish scripts that it finds in the /etc/ichange.d directory of the newly deployed software stack. This driver script provides access to the values specified in the archive parameters file, as supplied by the user.
Following is an example of a finish script that processes the archive parameters file created in the previous section:
#! /bin/sh case `cmgetprop telnet` in [Nn]*) telnet='#' ;; *) telnet= ;; esac case `cmgetprop ftp` in [Nn]*) ftp='#' ;; *) ftp= ;; esac case `cmgetprop finger` in [Nn]*) finger='#' ;; *) finger= ;; esac ed $SI_ROOT/etc/inetd.conf <</ /^#*telnet/s/^#*/$telnet/ /^#*ftp/s/^#*/$ftp/ /^#*finger/s/^#*/$finger/ w q / exit 0
When two or more finish scripts are included in the /etc/install.d directory, ensure that the ic_cfgparams file contains all of the parameters that the scripts process.
Store the finish scripts in the /etc/ichange.d directory prior to creating the Solaris Flash archive of the master system. The finish scripts must be part of the archive. If you have more than one finish script, they are processed in lexical order by file name.
The finish scripts must have permissions set to 755. If the scripts are not executable, then the Solaris Flash archive is not customizable.
Finish scripts use an environment variable called $SI_ROOT and a $PATH that includes the cmgetprop command.
SI_ROOT - This environment variable specifies the mount point of the file system being installed or updated.
For example, $SI_ROOT/etc/passwd points to the password file on the boot environment currently being installed.
cmgetprop - This tool is used by finish scripts to determine the current value of an archive parameter. See cmgetprop(1MCM).
The following example is based on the ic_cfgparams file described in Creating the Archive Parameters File. You might use cmgetprop as follows:
enable_telnet=`cmgetprop telnet`
This command line assigns the value associated with the telnet parameter to the shell variable enable_telnet.
The value of a parameter might be the default specified in the archive parameters description in ic_cfgparams, might come from a shared profile associated with the managed host, or might come from the host properties of the managed host. You can supply parameter values by using the browser interface. Modify values on the shared profile property page or the managed host property page. You can also supply parameter values by using the changemgr fileset and changemgr hostset commands of the command-line interface.