ok, just tested last posted script. same problem.
I changed the code to:
after the code 'times out' and EXITS i get the following still in my process list (ps -auxf):
char *script1 = "#!/bin/sh\n"
"printf \"hello world\"";
The script is acually doing a snmpdf (disk space analysis using SNMP) on a remote windows box with a ropey snmp daemon.
root 9822 0.0 0.3 2232 1012 pts/5 S 12:37 0:00 /bin/sh my_bash_script.sh
Now, is this a Linux issue? Is snmpdf doing something wierd?
One hack is to kill the PID of my_bash_script.sh from the C daemon using pid files, but I want ot get to the root of the problem.