When running a script on LINUX/UNIX System Agent, the job returns error code (or completion code) 1 and there is no output in spool

book

Article ID: 49531

calendar_today

Updated On:

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) CA Workload Automation Agent CA Workload Automation Agents DSERIES- SERVER CA Workload Automation DE - System Agent (dSeries)

Issue/Introduction

Description:

When UNIX/LINUX CA Workload Automation System Agent executes a shell script it returns exit code 1.

The agent does not capture any output from the script (if there is one expected) in the spool file.

Solution:

When a LINUX/UNIX shell script is executed, the output must be compared with the script execution from a console or a terminal. When a script is executed by the System Agent, the output may differ since the environment has changed. The shell script must be investigated if the System Agent does not capture any output.

There are several possible reasons when System Agent will not capture any output in the spool and also show the job exit code as 2. Here are some common ones:

  1. Shell has an interactive mode. The script may be forced to show the output to tty. E.g.

    echo "${Some output}" >/dev/tty

  2. All output has been redirected to /dev/null. E.g.

    echo "${Some output}" >/dev/null>2&1

Correct the out redirection accordingly and System Agent will be able to capture the job output.

Environment

Release: ATSAGE99000-11.3-Workload Automation AE-Remote Agent
Component: