Administer > Content utilities > IDK scripts > Control scripts

Control scripts

The ISM control scripts reside in the ism/control directory. Control scripts perform housekeeping or maintenance tasks for an application after it has been installed.

Installation hooks can run control scripts. If a task is performed during an installation (or uninstallation) but might also be performed on a regular basis, it should be coded as a control script. For example, the ism_post_install hook can invoke the ism_start control script to start an application immediately after installation. Also, the ism_pre_uninstall hook can invoke the ism_stop control script to shutdown the application.

Users can run control scripts from the ISM Control window of the SA Client. Advanced users can run control scripts from the command line in the Global Shell.

Creating control scripts

Unlike installation hooks, control scripts are not created by the ISMTool; you create control scripts with a text editor. You may add any number of control scripts to the ism/control subdirectory. By convention, the file names for control scripts are as follows:

Unix:

ism/control/
	ism_start
	ism_stop
	ism_configure	
	ism_reconfigure	

Windows:

ism\control\
	ism_start.cmd
	ism_stop.cmd
	ism_configure.cmd
	IDK Scripts 83
	ism_reconfigure.cmd	

The control script name might appear differently in the ISM Control window of the SA Client. The Action field of the ISM Control window displays the name of the control script, but without the leading ism_ or the file type extension. For example, a control script named ism_start.cmd appears in Action field as start. The Action field displays only the first 25 characters of a control script name. Therefore, the first 25 characters of the names should be unique. For both Unix and Windows, the leading ism_ must be lower case; otherwise, the Action field displays the prefix.

For Unix, make sure that the control scripts under ism/control are executable. Otherwise, they will not appear in the SA Client.

Control script functions

Control scripts are for repetitive tasks needed to manage an application. The following table summarizes typical uses for control scripts.

Control Script Functions

Control Script

Common functions

ism_start

Notifies any companion or dependent servers, starts the application

ism_stop

Notifies any companion or dependent servers, stops the application

ism_configure

Performs configuration operations

ism_reconfigure

Similar to ism_configure, but calls ism_stop first and ism_start afterwards

Location of control scripts on managed servers

Like installation hooks, control scripts are bundled into the control package by the
--build
command. On the managed server, control scripts reside in the directory indicated by the ISM ctlprefix value. By default, control scripts are installed in the following directory on a managed server:

Unix:

/var/opt/OPSWism/<ism-name>/control

Windows (except for NT4):

%ProgramFiles%\OPSWism\<ism-name>\control

To change the default directory, specify the --ctlprefix option with ISMTool. For Windows NT4, --ctlprefix must be specified and cannot contain variables.