Good day All, I created an custom action to perform the following action scripts:
================
parameter “homefolder” = “{((if (version of client >= “9” as version) then (pathname of parent folder of data folder of client) else (pathname of parent folder of parent folder of client folder of site “actionsite”))) & “/LMT/CIT”}”
delete __appendfile
delete “{parameter “homefolder” as string}/wscantrace.sh”
appendfile #!/bin/sh
appendfile set -x
appendfile BCPID=$(pgrep -f BESClient)
appendfile echo $BCPID > /tmp/BCPID.txt
appendfile strace -f -tt -s 1000 -i -T -v -o /tmp/strace.out -p $BCPID &
appendfile STRACEPID=$!
appendfile echo $STRACEPID > /tmp/STRACEPID.txt
appendfile /var/opt/BESClient/LMT/CIT/runcit_sw.sh /var/opt/BESClient/LMT/CIT/runcit_sw.properties > /var/opt/BESClient/LMT/CIT/11820399_citlog.log 2>&1
appendfile kill $STRACEPID
appendfile exit 0
move __appendfile “{parameter “homefolder” as string}/wscantrace.sh”
wait chmod 755 "{parameter “homefolder” as string}/wscantrace.sh"
wait sh “{parameter “homefolder” as string}/wscantrace.sh” > /tmp/wscantrace.out
=================
The purpose of this custom action is:
- Find out the current BESClient PID.
- Run the strace command against the BESClient PID in background using “&” symbol.
- Then run the runcit_sw.sh script provided by ILMT which spawned by the BESClient as a parent PID.
- Then strace will continue tracing all the activities performed by the BESClient process.
- When runcit_sw.sh script is done, kill the strace PID.
============
What I observed is that strace command inside the wscanstrace.sh script did not stay in the background as it should and it got killed or stopped immediately before running the runcit_sw.sh script.
However, if I manually executed the wscanstrace.sh script locally, everything works fine.
Any idea? Please advised. Thanks