Another option would be
pstree. fuser will work nicely, unless script A runs too quickly for you to run the command manually. Or I guess you could put an fuser command in the script in a similar way to what I mention below.
Modify script A to include a
pstree command, that has its output redirected to a file. Something like this:
Code:
pstree -p > /tmp/script_A_pstree_$$.out
Then you can open the output file, and search for the PID of script A. The script's PID is recorded in the filename itself; that's what the $$ expands to. The diagram should show you what process started the script.
Just be sure to remove the pstree command from the script once you find out. Otherwise, you'll chew through disk space, saving pstree output everytime the script runs.