direct Perl script command jobs are not being interpreted correctly

book

Article ID: 195528

calendar_today

Updated On:

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - System Agent (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) CA Workload Automation Agent CA Workload Automation AE

Issue/Introduction

Command job syntax is like this:

/* ----------------- perl_test ----------------- */

insert_job: perl_test   job_type: CMD
command: /home/autosys/test.pl
machine: Agent-Name.company.com
owner: autosys
permission:
date_conditions: 0
alarm_if_fail: 1
alarm_if_terminated: 1

 

contents of test.pl

#!/bin/perl
print "test \n";

 

Spool files contain a Shell verification failure.

07/20/2020 17:11:25.820-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH/MAIN
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH/MAIN/WAAE_WF0.1
07/20/2020 17:11:25.821-0400 CAWA_I_20005 AFM: 20200720 17112579+0400 WA_AGENT JavaAgent#[email protected]_SCH 102.9_1/WAAE_WF0.1/MAIN RUN . Data(Command="/home/autosys/test.pl") Env(AUTOSERV=R12,AUTO_JOB_NAME="perl_test",AUTORUN="9-1") User(...) Password(...) MFUser(...) WOBRequestID(D353D68C4E54589256E7847B6EA1F5D72842197A15952794858020) GblEnv(AUTOSYS="/opt/CA/WorkloadAutomationAE/autosys",AUTOROOT="/opt/CA/WorkloadAutomationAE",EWAGLOBALPROFILE="/etc/auto.profile") MgrEnv(EWAGLOBALPROFILE="/etc/auto.profile") JLErase(TRUE) SpoolErase(TRUE)
07/20/2020 17:11:25.822-0400 CAWA_I_20009 establishUser(...)-Run as user: 'autosys'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 setWorkingDir()-Setting current working directory(IWD) to: '/home/autosys'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 fileIsScriptFile()-Verify file : '/home/autosys/test.pl'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 Selecting shell for wrapper scripts
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Using shell from agentparm.txt: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Shell checked. Valid shell found: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Shell to use: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 Selecting shell to execute command
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Using shell from script: '/bin/perl'
07/20/2020 17:11:25.822-0400 CAWA_E_20050 Shell verification failed. Error code: 4014

Cause

agentparm.txt has a checkvalidshell parameter set to true, and the list is validated by the agent.

oscomponent.loginshell=false
oscomponent.defaultshell=/bin/sh
oscomponent.validshell=/usr/bin/sh,/bin/csh,/bin/ksh,/usr/bin/ksh,/bin/sh,/bin/bash
oscomponent.checkvalidshell=true
oscomponent.lookupcommand=true
oscomponent.joblog=true

 



 

 

Because of the reference to 


07/20/2020 17:11:25.820-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH/MAIN
07/20/2020 17:11:25.821-0400 CAWA_I_20009 About to chmod the spool directory: /opt/CA/WorkloadAutomationAE/SystemAgent/WA_AGENT/spool/R12_SCH/MAIN/WAAE_WF0.1
07/20/2020 17:11:25.821-0400 CAWA_I_20005 AFM: 20200720 17112579+0400 WA_AGENT JavaAgent#[email protected]_SCH 102.9_1/WAAE_WF0.1/MAIN RUN . Data(Command="/home/autosys/test.pl") Env(AUTOSERV=R12,AUTO_JOB_NAME="perl_test",AUTORUN="9-1") User(...) Password(...) MFUser(...) WOBRequestID(D353D68C4E54589256E7847B6EA1F5D72842197A15952794858020) GblEnv(AUTOSYS="/opt/CA/WorkloadAutomationAE/autosys",AUTOROOT="/opt/CA/WorkloadAutomationAE",EWAGLOBALPROFILE="/etc/auto.profile") MgrEnv(EWAGLOBALPROFILE="/etc/auto.profile") JLErase(TRUE) SpoolErase(TRUE)
07/20/2020 17:11:25.822-0400 CAWA_I_20009 establishUser(...)-Run as user: 'autosys'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 setWorkingDir()-Setting current working directory(IWD) to: '/home/autosys'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 fileIsScriptFile()-Verify file : '/home/autosys/test.pl'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 Selecting shell for wrapper scripts
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Using shell from agentparm.txt: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Shell checked. Valid shell found: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Shell to use: '/bin/sh'
07/20/2020 17:11:25.822-0400 CAWA_I_20009 Selecting shell to execute command
07/20/2020 17:11:25.822-0400 CAWA_I_20009 getShell()-Using shell from script: '/bin/perl'
07/20/2020 17:11:25.822-0400 CAWA_E_20050 Shell verification failed. Error code: 4014

Environment

Release : 11.4

Component : CA Workload Automation AE (AutoSys)

Resolution

Add reference to /bin/perl (or appropriate location of PERL) to the validshell parameter and restart the agent.

 

oscomponent.loginshell=false
oscomponent.defaultshell=/bin/sh
oscomponent.validshell=/usr/bin/sh,/bin/csh,/bin/ksh,/usr/bin/ksh,/bin/sh,/bin/bash,/bin/perl
oscomponent.checkvalidshell=true
oscomponent.lookupcommand=true
oscomponent.joblog=true