search cancel

What happens when a job is run on the Automic UNIX Agents under different UNIX shells

book

Article ID: 88962

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

What happens when a job is run on the Automic UNIX Agents under different UNIX shells?

Why does the command 'env' give a different result inside a job ran by the agent or directly executed in the Unix command line?

Environment

Component: Unix Agent

Resolution

Detailed Description and Symptoms

The Agent/Executor does not go through the 'login-shell' process. Generally, no User environment is loaded.

The Agent/Executor does not do a 'su', but a child-process is generated with the 'execl' command. This child-process runs with the user specified in the login-object on the "Attributes" tab of the job if the shell specified in "Start parameter" is preceded by a dash (ex.:-ksh). If the shell specified in "Start parameter" is not preceded by a dash (ex.:ksh), job will run under the profile of the user that started the  Agent/Executor.


Investigation

Different options may be specified for calling a Shell. The following occurs when a shell  is specified on a Automic UNIX job:

If you choose for example '-csh,-ksh...' the appropriate default profile (for example: '.cshrc-file') is loaded, but no system profile is loaded.

If no shell is defined, the default shell from the passwd file is used.


Solution

There are 3 alternatives that can be used to set the right environment:

  1. Set environment variables in the job
  2. Define the job a shell script in unix and start it with 'su - <username> -c <shellscript>'
  3. Run the executor in 'batch'-mode (to be set in the ini-file, refer to the Automic documentation.)
  4. Use a specific HEADER to be defined in client 0

(In options 2 and 3, the Agent has to be run with the root account.)