Use > Server patching > Patch management for Ubuntu > Patch installation > Specify install scripts for an Ubuntu patch installation

Specify install scripts for an Ubuntu patch installation

For each patch, you can specify a command or script to run before installation or after installation. A pre-install script, for example, could check a certain condition on the managed server. If the condition is not met or if the pre-install script fails, the patch would not be installed. A pre-install script could also be used to shut down a service or application before it is patched. A post-install script could be used to perform a certain cleanup process on the managed server.

You can also specify the following types of scripts to run on the managed server before or after an installation or download phase:

  • Pre-Download: A script that runs before patches are downloaded from SA to the managed server. This is available only if you select Staged in the Install Options step.
  • Post-Download: A script that runs after patches are downloaded from SA to the managed server and before the patch is installed. This is available only if you select Staged in the Install Options step.
  • Pre-Install: A script that runs before patches are installed on the managed server.
  • Post-Install: A script that runs after patches are installed on the managed server.

To specify a pre-install script:

  1. From the Install Patch window, click Next to advance to the Pre & Post Actions step.
  2. Select the Pre-Install tab. You may specify different scripts and options on each of the tabs.
  3. Select Enable Script. This option enables the remainder of the fields on the tab. If Enable Script is not selected, the script will not run.
  1. Select either Saved Script or Ad-Hoc Script.

    A Saved Script has been previously stored in Server Automation with the SA Client. To specify the script, click Select.

    An Ad-Hoc script runs only for this operation and is not saved in Server Automation. Select the Type, such as .bat. In the Script box, enter the contents of the script, including the drive letter of where the script is located, such as echo dir>> C:\temp\preinstall1.log. If you do not enter a drive letter, the default is %SYSTEMDRIVE%, which is where the system folder of Ubuntu is installed.

  2. If the script requires command-line flags, enter the flags in the Command text box.

  3. Specify the information in the User section. If you choose a system other than Local System, enter the User Name, Password, and Domain. The script will be run by this user on the managed server.

  4. To stop the installation if the script returns an error, select the Error check box.

  5. Click Next to go to the next step or click Cancel to close the Install Patch window.