Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


2.6.23 Running the initialization script file

You can run a specific common script file before the job controller of JP1/Advanced Shell runs the job definition script file. By running a specific common script file before the job definition script file is run, you can specify the system-common initial settings, such as substituting values into variables, defining aliases, and moving data to the work directory.

Organization of this subsection

(1) Overview of the initialization script file

The job controller handles the following files as script files:

Script files handled by the job controller
  |--- Job definition script file
  |--- External scripts
  |          |--- External script files for the #-adsh_script command
  |          |--- External script files for the . (dot) command
  |          |--- Initialization script file
  |
  |--- .env files
  |--- [For Windows only] UNIX-compatible commands (script format)

The initialization script file is assumed to be a kind of external script file. Therefore, the job controller runs the initialization script file as an external script file, which is part of a job.

(2) Initialization script file

The initialization script file is a script file that the job controller runs for initialization when running the job definition script. If the INIT_SCRIPT_READ environment setting parameter is specified, the job controller reads and runs an initialization script file immediately before running the root job. However, the job controller outputs the KNAX6504-E message and terminates abnormally without running the initialization script in the following cases:

The following table describes how the behavior of the job controller changes depending on the specification of the INIT_SCRIPT_READ environment setting parameter and the status of the initialization script file.

Table 2‒24: Specification of INIT_SCRIPT_READ, status of the initialization script file, and behavior of the job controller

No.

Specification of INIT_SCRIPT_READ

Status of the initialization script file

Behavior of the job controller

Presence

Role for reading

1

NO (Alternatively, this parameter is not specified.)

--

--

Does not run the initialization script file.

2

YES

Not present

--

3

Present

A role for reading the file is not granted.

4

A role for reading the file is granted.

Runs the initialization script file.

Legend:

--: Not applicable

The system administrator is responsible for creating and setting up the initialization script file. The created initialization script file takes effect in only a specific path. The following table shows the valid path of the initialization script file.

Table 2‒25: Valid path of the initialization script file

No.

Environment

Valid path of the initialization script file

1

Windows (development environment)

common-application-folder\HITACHI\JP1AS\JP1ASD\conf\adshinit_root.ash

2

Windows (execution environment)

common-application-folder\HITACHI\JP1AS\JP1ASE\conf\adshinit_root.ash

3

UNIX

/opt/jp1as/conf/adshinit_root.ash

The job controller reads files in the order shown in the following table. Therefore, if an environment variable is set in both the environment file and the initialization script file, the setting specified by the initialization script file overrides the setting specified by the environment file.

Table 2‒26: File read order of the job controller

Order

File type

Remarks

1

System environment file

--

2

Job environment file

--

3

.env file

This file is read if YES is set for the KSH_ENV_READ environment setting parameter.

4

Initialization script file

This file is read if YES is set for the INIT_SCRIPT_READ environment setting parameter.

5

Job definition script file

--

Legend:

--: Not applicable

In the initialization script file, specify the initialization processing to be performed when the job controller starts. Note that the following commands must not be used in the initialization script file:

The execution results of the commands specified in the initialization script file are output to the job execution log in the same way as for the commands specified in the job definition script file. The contents of the initialization script file are not output to the script image file.

(3) Notes

(4) Preparation for running the initialization script file

To run the initialization script file, use the following procedure:

  1. Specify YES for the INIT_SCRIPT_READ environment setting parameter.

    #-adsh_conf INIT_SCRIPT_READ YES
  2. Place the initialization script file to be run in a valid path shown in Valid path of the initialization script file.

(5) Examples

Case in which the initialization script file terminates normally