Sun Update Connection - Enterprise 1.0 User's Guide

Actions

An action is a script, binary, or executable that does something to a host. You categorize your actions as either Pre or Post.

Pre-actions are run before the tasks of a job begins. If a pre-action finishes successfully, it returns a value of zero and the next actions of the job are carried out. If a pre-action returns a non-zero value, the job stops.

Post-actions are run after the other tasks of a job are completed. If a post-action returns a non-zero value, the job ends with a failure status.

For example, you want to install the Apache server. A prerequisite of Apache installation is that /home be unmounted. After it is installed, you want to run other applications that need /home to be mounted.

You create a pre-action unmount_home.sh:

#!/bin/sh -f
# unmount home from remote server
umount server01:/home
            if [ $?==0]; then exit 0; fi

You create a post-action mount_home.sh:

#!/bin/sh -f
# mount home to remote server
mount server01:/home
            if [ $?==0]; then exit 0; fi

You upload these actions. Then you create a profile to install Apache, and add these actions to the job basket. The job does the following:

  1. runs any probes that you put in

  2. unmounts /home

  3. installs Apache

  4. mounts /home