Top
Systemwalker Software Configuration Manager Software Parameter Setting Guide for ServerView Resource Orchestrator
FUJITSU Software

6.1.3 Software Setup Script

Software setup scripts are used to set up parameters in software. These scripts are forwarded to virtual servers and executed on them.

Software setup scripts consist of multiple files. The batch files that can be used in Windows and shell scripts that can be used in Linux are defined. An explanation of these files is given below.

Format of start up scripts (batch file) [Windows]

Create batch file start up scripts (startup.cmd) in the following format:

First, the environment variables setup script (setenv.cmd) is called. Zero is returned if processing was successful, and if processing failed a value other than 0 is returned. Standard output and standard error output are output in the agent log.

@echo off
setlocal
@rem Setup environment variables
call .\setenv.cmd
@rem Software setup processing
<Processing of each software package>
@rem Return (normal) result
if ERRORLEVEL 1 goto ERROR_END
endlocal
exit /B 0
@rem Return (abnormal) result
:  ERROR_END
echo ERROR0001 setup failed 1>&2
endlocal
exit /B 1

Format of start up script (shell script) [Linux]

Create the start up scripts of the shell script (startup.sh) in the following format:

First, the environment variables setup script (setenv.sh) is called. Zero is returned if processing was successful, and if processing failed a value other than 0 is returned. Standard output and standard error output are output in the agent log.

#!/bin/sh
# Setup environment variables
source ./setenv.sh
# Software setup processing
<Processing of each software package>
# Return result
if [ $? = "0" ]; then
 # Return normal
 exit 0
else
 # Return abnormal
 echo "ERROR0001 setup failed" 1>&2
 exit 1
fi

Format of environment variable setup script (batch file) [Windows]

This product creates batch file environment variable setup scripts (setenv.cmd) in the following format:

Environment variable names are set by the parameter key in the software setup information (parameter information). However, while the parameter key is a combination of numerics and ".", the environment variable name is a name in which "." has been converted to "_". Environment variable values are set by the parameter values in parameter information and software setup information.

set Parameter key=Parameter value
<Defines only as many environment variables as there are parameters>

Format of environment variables setup script (shell script) [Linux]

This product creates shell script environment variables setup scripts (setenv.sh) in the following format:

Environment variable names are set by the parameter key in the software setup information (parameter information). However, while the parameter key is a combination of numerics and ".", the environment variable name is a name where "." has been converted to "_". Environment variable values are set by the parameter values in parameter information and software setup information.

set Parameter key=Parameter value
<Defines only as many environment variables as there are parameters>

Note

  • Software setup scripts

    • Execution sequence

      Software setup scripts are run in the order the software information is written in the image information.

  • Start up scripts

    • Execute authority

      In Windows, startup scripts are executed by the Administrator.

      In Linux, startup scripts are executed by the superuser.

    • Current directory

      The current directory is the path where the start up script file is stored.

    • Execute authority [Linux]

      Execute authority is automatically set for the start up script shell script on execution.

    • Linefeed

      In Windows versions, linefeed is CR+LF.

      In Linux versions, linefeed is LF.

    • Byte order mark (BOM) [Linux]

      Do not include UTF-8 byte order marks (BOMs) in shell scripts.

  • Environment variables setup scripts

    • Defining environment variables

      If a parameter value is not set, no environment variable will be defined. Therefore, the start up script determines whether to set the parameter value depending on whether or not an environment variable is defined.

      The method of determining whether an environment variable is defined is as follows.

      For batch files: [Windows]

      if defined <Environment variable> (<Defined process>) else <Undefined processing>
      Example: 
      set PARAM=%hostname%	
      if defined parameter_Key1 (set PARAM=-v %parameter_Key1% %PARAM%)

      For shell scripts: [Linux]

      ${<Environment variable>+${<Environment variable>}}
      Example: 
      PARAM=${hostname}
      PARAM="${parameter_Key1+"-v ${parameter_Key1}"} ${PARAM}"
    • Empty string of values [Windows]

      Windows environment values cannot set an empty string. Therefore, batch file empty strings set "__EMPTY__" ("__"is two "_" and "_" in a row). Therefore, please note that "__EMPTY__" cannot be used as a parameter value.

  • File attachments

    • Execute authority [Linux]

      If a shell script is included in an attached file, set the execution right inside the shell script start up script.