Technical Blog Post
Abstract
How to debug a run task in Connect:Direct for UNIX
Body
Do you have a process with a run task step that does not execute what you expected ?
For example you have this run task to move a file to another directory :
RT1 task pnode (pgm=unix)
sysopts="mv '/home/user/filein' '/home/user/testdir/fileout' "
but it fails with feedback code 1 and the file is not moved ?
Try redirecting the standard error and standard output to a log file:
RT1 task pnode (pgm=unix)
sysopts="mv '/home/user/filein' '/home/user/testdir/fileout' > /tmp/cdlog 2>&1"
The /tmp/cdlog file should show why the mv command is failing, for example the user submitting the process might not have the correct permissions.
If your run task is calling a script:
RT1 task pnode (pgm=unix)
sysopts="/home/user/okscript.sh"
Add these two lines at the beginning of your script:
exec > /tmp/shellout.$$ 2>&1
set -x
(the $$ characters will be substituted by the shell pid during execution)
You should then get a shellout... file with more detailed trace info about the execution of your shell script.
UID
ibm11124067