A "pre-execution script error check" task occurs when a pre-execution script has been registered and settings have been configured to terminate processing when an error occurs. For scripts, "0" is handled as normal termination, whereas values other than "0" are handled as errors. Refer to "4.2.6.1 Pre-execution and Post-execution Scripts" for information on pre-execution scripts.
If a "pre-execution script error check" task occurs, a log will be output to the Details field in the Pre-execution script error check tab window, indicating the type of error that has occurred.
Refer to the "returnCode" information. The following table shows the expected values and their meaning:
Keyword | returnCode | Meaning |
---|---|---|
executeCommand<Script path> | Other than 0 | Logs are output using the following format: Example: <2012-04-17 16:25:09>:executeCommand ["C:/Fujitsu/Systemwalker/SWCFMGA/var/process/75974/pre_script.bat"] message: The operation component was successful. command_stdout: command_stderr: command_rcode:1 returnCode:1 The value of "command_rcode" is the return value output by the script. If the value of "command_rcode" is other than "0", this will be treated as an error. Check the script by referring to the return value. |
All | 189 | If one of the following values has been output for "message", this means that the connection for network communications with the business server has failed. [LinkExpRBA] CategoryCode: 50 [LinkExpRBA] ErrorCode: 80 [Actions] Check the following items:
|
If one of the following values has been output for "message" or "server_check_result", this means that a timeout has occurred during communications with the business server. [LinkExpRBA] CategoryCode: 50 [LinkExpRBA] ErrorCode: 60 [Actions] The following are the possible causes of the problem:
Check these possible causes and then try again. If the situation still does not change despite the retry attempt, collect investigation data using the problem investigation data collection command (swcfmg_collectinfo), and then contact Fujitsu technical support. | ||
If one of the following values has been output for "message", this means that a timeout has occurred during communications with the business server. [LinkExpRBA] CategoryCode: 50 [LinkExpRBA] ErrorCode: 60 [Actions] The following are the possible causes of the problem:
Check these possible causes and then try again. If the situation still does not change despite the retry attempt, collect investigation data using the problem investigation data collection command (swcfmg_collectinfo), and then contact Fujitsu technical support. | ||
Other | Collect investigation data using the problem investigation data collection command (swcfmg_collectinfo), and then contact Fujitsu technical support. |
Make Choice panel
When the Retry button is clicked, the script will be executed again.
When the Continue button is clicked, the error will be ignored and processing will continue.
When the Cancel button is clicked, patch distribution/application processing will terminate.
It is possible to register process scripts on business servers before or after patch distribution or application is executed.
In order to apply Fujitsu middleware patches, a script specifying the application processing must be created and then registered as a post-execution script.
Example of creating a script that applies a Fujitsu middleware patch
The commands for the UpdateAdvisor (middleware) are used to apply Fujitsu middleware patches.
The following example shows a post-execution script that is executed after Fujitsu middleware patches are applied.
The path to the folder where distributed patches are stored is automatically set to the "DISTRIBUTE_PATCH_PATH" environment variable. The path to the folder where patches are stored is different for each distribution. All of the patches that have been distributed to this folder will be applied.
Example:
[Windows]
"C:\Program Files (x86)\Fujitsu\UpdateAdvisor\UpdateAdvisorMW\uam" add -s -d %DISTRIBUTE_PATCH_PATH% |
[Linux]
/opt/FJSVfupde/bin/uam add -s -d $DISTRIBUTE_PATCH_PATH |
To apply multiple patches, enter additional lines to the script above for each patch.
Refer to "Applying Updates (Using uam add)" in the UpdateAdvisor (middleware) help for information on the commands for the UpdateAdvisor (middleware).
The sample file for the script for applying Fujitsu middleware patches is stored in the following directory.
Copy the file from this directory, and edit the file as required before using it.
Both of the script files for Windows and Linux are stored on the admin server, while only either of them is stored on business servers according to the operating system used.
Admin server
[Windows]
<Systemwalker Software Configuration Manager installation directory>\SWCFMGM\sample |
[Linux]
/opt/FJSVcfmgm/sample |
Business server
[Windows]
<Systemwalker Software Configuration Manager installation directory>\SWCFMGB\sample |
[Linux]
/opt/FJSVcfmgb/sample |
For Windows: win_mw_patch.bat
For Linux: lin_mw_patch.sh
Notes on creating scripts
The return values that can be used with scripts
Create scripts so that they output "0" as a return value to indicate normal completion and a value other than "0" as a return value to indicate an error. Note that return values between 159 and 240 cannot be used.
The file names for scripts
Only printable ASCII codes can be used for the names of script files.
For Windows, the script file extension should be either ".bat" or ".cmd".
Notes on creating a script for use with different platforms
To create a script for use with different platforms, the linefeed code must be converted to match the linefeed code used by the operating system.
For Windows, the linefeed code is CRLF (carriage return + linefeed).
For Linux, the linefeed code is LF (linefeed).
Commands that require interactive processing
If commands that require interactive processing are entered in the script, the script processing will wait for input on the business server, with the result that the script processing will be unable to complete.
Do not execute commands that require interactive processing from scripts.
For Windows, if a command that requires interactive processing is executed, an interactive service may start on the business server and a dialog box prompting the user to respond may be output. In this case, finish the script processing by accessing the business server and selecting which processing to perform with the interactive service.
Checking the application conditions and application methods for Fujitsu middleware patches
Before creating a script that applies a Fujitsu middleware patch, check the application conditions and application method specified in the update information file.
Note that updates that cannot be applied just using scripts cannot be applied by Systemwalker Software Configuration Manager.
Example of log output when an error occurs
Errors with pre-execution and post-execution scripts are determined by taking "0" to indicate normal termination and values other than "0" to indicate errors.
If a script results in an error with a value other than "0", and Continue was not selected as the behavior for when script errors occur, then either a "pre-execution script error check" task or a "post-execution script error check" task will occur.
The following log can be checked in the Details section of the task tab:
Example:
<2012-04-16 16:23:24>:executeCommand["C:/Fujitsu/Systemwalker/SWCFMGA/var/process/65359/pre_script.bat"] message:The operation component was successful. command_stdout: command_stderr: command_rcode:1 returnCode:1
The value of "command_rcode" above is the return value output by the script.
Review the script, taking this value into consideration.
Example of script attachments
For "Patch distribution acceptance" and "Patch application acceptance" tasks, the registered scripts are attached as an attachment file.
An example is shown below.