Unix Agent Incorrectly Inherits Host User Environment Variables
search cancel

Unix Agent Incorrectly Inherits Host User Environment Variables

book

Article ID: 426741

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

When running jobs on a UNIX-based Java Agent (starting with version 24.x), the spawned process environment incorrectly inherits all environment variables from the user who started the Agent on the host (e.g., automic). This occurs even if the job is defined to run under a different user in the Login Object.

Expected Behavior: The job session should have a "clean" environment isolated from the Agent's host user, matching the behavior of legacy C-based Agents (v12.3, v21.0).

Actual Behavior: The job environment includes leaked variables from the Agent's owner, such as PATH, LD_LIBRARY_PATH, and custom variables set in the Agent's startup shell.

Example setup to reproduce:

  1. Stop the UNIX agent
  2. Export some variables on the command line, for example:

    export VAR1=XXXXXXXX
    export VAR2=YYYYYYYY

  3. Start the agent using a nohup command
  4. Create a unix job that greps for the VAR# environment variables set above, example:

    env | grep VAR

  5. Execute the job, being sure that it uses a different user than the one who starts the agent in step 3 above
  6. Check the job report for the VAR1 and VAR2 shown above - they should not show up in the list of variables

Environment

Component: UNIX Agent (java-based)
Versions affected: 24.x

Cause

The Java-based Agent was found to copy and subsequently alter its own environment for spawned processes rather than creating a clean, isolated environment for the new job session. This was confirmed as a defect under DE179360.

Resolution

The issue has been resolved. A fix is available in the following version:

UNIX Java Agent 24.4.3 HF1 (and all subsequent releases).

The fix restores the original behavior where the spawned process environment does not inherit the Agent host user's environment variables.