Software Distributor Administrator Guide (September 2010)
11.7 Control Script Input and Output
• Except for request scripts, control scripts must not be interactive. This includes
messages such as, Press return to continue.
• Except for request scripts, all control scripts are executed by the agent on the target
systems. Request scripts are executed by the controller (swinstall, swconfig,
or swask).
• Except for request scripts, no method of input to control scripts is supported.
Request script data is input by the user through the swask command or the ask
option for swinstall or swconfig.
• Control scripts must write messages for error and warning conditions to stderr
(echo &>2), and write all other messages to stdout. Control scripts must not write
directly to /dev/console or attempt any other method of writing directly to the
display.
The stdout and stderr from a control script is redirected by the agent to the
log file (var/adm/sw/swagent.log) within the primary or alternate root
directory in which the task is being performed.
For interactive swinstall and swremove sessions, you can display and browse
this logfile.
• Only minimal, essential information should be emitted by control scripts. Ideally,
no output is emitted if the script successfully performs all of its actions.
• In the agent logfile, the execution of each control script is prefaced by a “begin
execution” message:
* Running "checkinstall" script for product "PRODUCT"
* Running "checkinstall" script for fileset
"PRODUCT.FILESET".
Any messages generated by the script will follow. If the script returns a value other
than 0 (SUCCESS), then a concluding message such as the following, is written:
ERROR: The "unconfigure" script for "PRODUCT.FILESET"
failed (exit code "1"). The script location was
"/var/adm/sw/products/PRODUCT/FILESET/unconfigure".
* This script had errors but the execution of this
product will still proceed. Check the above output
from the script for further details.
WARNING: The "unconfigure" script for
"PRODUCT.FILESET" failed (exit code "2"). The script location was
"/var/adm/sw/products/PRODUCT/FILESET/unconfigure"
* This script had warnings but the execution of this
product will still proceed. Check the above output
from the script for further details.
• The messages written by a control script must conform to the following format
conventions whenever possible.
11.7 Control Script Input and Output 289