When performing patch application, patch distribution, parameter setting, script execution, and configuration modification, it is possible to execute the following scripts or commands on business servers.
Pre-execution/post-execution scripts for patch application, patch distribution, and parameter setting operations
Script execution scripts
Script or command execution for configuration modification
Advisory notes for these scripts and commands are shown below.
Advisory notes when creating scripts and specifying commands
Valid return values for use in scripts and commands
It is recommended to create the script so that it returns "0" when successfully completed, or another value when an error occurs - Note that values from 159 to 240 cannot be used as return values.
Script file names
The file name for a script must be composed of 155 or less characters, using alphanumeric characters, spaces, and the following symbols:
~ _ - . ( )
If a script with a file name exceeding 155 characters is specified, an error may occur when the script is executed.
In Windows, ".bat" or ".cmd" should be used for the script extensions. Shell scripts created using PowerShell cannot be executed.
Notes on creating scripts for use across different platforms
When creating scripts for use across different platforms, the line feed code must be converted to suit the operating system:
In Windows, use CR/LF (carriage return followed by line feed).
In Linux, use LF (line feed).
Commands that cannot be used with a script
Do not execute the following commands from a script or a command. Executing these commands may cause the script to enter standby status on the business server and the script process may not be completed.
Commands that require interaction [Windows/Linux/Solaris]
Commands that require restarting or stopping of the OS [Windows/Linux/Solaris]
Commands for which a window opens during execution [Windows]
AT commands [Windows]
Commands that run in full-screen mode [Linux/Solaris]
User
Scripts and commands are executed as the following user according to the OS on the business server:
[Windows] LocalSystem account
[Linux/Solaris] root
Single-user mode [Linux/Solaris]
When executing scripts or commands in single-user mode, the service called FJSVsglcf is automatically registered. Execute scripts or commands after checking that the FJSVsglcf service is not registered. After execution of scripts or commands, the FJSVsglcf service is automatically deleted.
The following files for single-user mode are automatically generated when switching to single-user mode. The original file is backed up with "_FJSVsglcf" appended to the file name, and then the file backed up after executing scripts or commands is restored. For this reason, do not delete the backed up file created when executing scripts or commands while using single-user mode.
[Linux]
For Red Hat Enterprise Linux 5 or Red Hat Enterprise Linux 6
/etc/inittab
For Red Hat Enterprise Linux 7
/etc/systemd/system/default.target
The OS is restarted when switching to and from single-user mode. Note the following:
When executing the post-execution script of patch deployment using single-user mode, as the OS is restarted using the post-execution script, it is not necessary to specify restarting of the OS when requesting the job.
When executing scripts or commands for the global zone using single-user mode, non-global zones are stopped or restarted by restarting of the OS of the global zone. [Solaris]
The jobs including execution of scripts or commands of the target server with single-user mode are, "Waiting", "Running", or "Selecting (abnormal)". New jobs including execution or commands using single-user mode cannot be requested.
When scripts or commands executed using single-user mode do not finish within one hour, an error will occur and the job will be aborted. When executing scripts or commands using single-user mode, specify scripts or commands which can be completed within an hour.
Asynchronous execution [Windows/Linux/Solaris]
When using asynchronous execution for executing commands, note the following:
Specification of a normal return code
When a command is executed asynchronously, specification of the normal return code is ignored.
Confirming the standard output, standard error output, and return code
When a command is executed asynchronously, standard output, standard error output, and the return code cannot be confirmed using the Job Management function.
When Windows is running on the business server, standard output and standard errors can be confirmed using the log (swcfmga_configuration_log) for the business server. When Linux or Solaris is running on the business server, standard outputs, standard errors, and return codes can be confirmed using the log for the business server (swcfmga_configuration_log).
Errors and problems may occur during post-processing
When modifying configurations, multiple processes (command execution, file transfer, etc.) can be performed consecutively on a single server. When asynchronous command execution is performed during pre-processing, errors and problems may occur during post processing.
The combinations of processing which may cause errors and problems are as follows:
Pre-processing: Asynchronous command execution in multi-user mode
Post-processing: Command or script execution in single-user mode (problem)
This post-processing restarts the OS in order to switch into single-user mode. As a result, the asynchronous command execution performed during pre-processing may be stopped.
Post-processing: Restart of the OS (problem)
This post-processing restarts the OS. As a result, the asynchronous command execution performed during pre-processing may be stopped.
Pre-processing: Asynchronous command execution in single-user mode
Post-processing: A process other than server operation check (error)
This pre-processing performs asynchronous command execution in single-user mode. During that period, any process other than server operation check cannot be performed and such processing returns an error.
Post-processing: Server operation check (problem)
This pre-processing performs asynchronous command execution in single-user mode. When server operation check is performed as post-processing during that period, the process returns that the server is not operating.
The combinations of processing which may cause errors and problems are as shown in the following table.
Process Type | Post-Processing | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Command execution | Script Execution | Server | Restart Operating System | File Distribution | File Collection | ||||||||
Process Type | Single- | Multi- | Single- | Multi- | Single- | ||||||||
Asynchronous | Synchronous | Asynchronous | Synchronous | Asynchronous | |||||||||
Pre-processing | Command execution | Multi- | Synchronous | - | - | - | - | - | - | - | - | - | - |
Asynchronous | - | - | R | R | - | R | - | R | - | - | |||
Single- | Synchronous | - | - | - | - | - | - | - | - | - | - | ||
Asynchronous | E | E | E | E | E | E | R | E | E | E | |||
Script execution | Multi-user | - | - | - | - | - | - | - | - | - | - | ||
Single-user | - | - | - | - | - | - | - | - | - | - | |||
Server operation check | - | - | - | - | - | - | - | - | - | - | |||
Restart of operating system | - | - | - | - | - | - | - | - | - | - | |||
File Distribution | - | - | - | - | - | - | - | - | - | - | |||
File collection | - | - | - | - | - | - | - | - | - | - |
-: No problems
R: There is a risk of problems
E: An error may occur
Example of log output when an error occurs
One of the following can be specified as the error judgment method of scripts and commands. For script execution and command execution for configuration modification, a return value for normal executions can be specified.
"0" is considered a normal execution while any other value is considered an error.
All return values are considered a normal execution.
When a script or a command is considered an error, the job status becomes "Selecting (abnormal)". In the Process details section of the Job Management window, the return value, standard output, and standard error of the script and command are displayed. Review the script and command referring to this value.
Corrective action when a timeout occurs
When a script or command process is not completed due to hang-up or other reasons, or when a business server stops during processing, a timeout error occurs when 12 hours have elapsed since the start of the process and the following message is displayed in the Process details window. In addition, the job status becomes "Selecting (abnormal)". Review the script and command, and perform retry, continuation, or cancellation of operations.
CFMGP20008 An error has occurred during command execution. [Return value:{0}][Command: The specified script or command][Details: The operation component was successful.]Example of script attachments
The registered script can be downloaded from the Process details section of the Job Management window on the management console.
An example is shown below.