LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   TCL/expect - parent hangs when child dies (http://www.linuxquestions.org/questions/programming-9/tcl-expect-parent-hangs-when-child-dies-541055/)

Hewson 03-27-2007 12:08 PM

TCL/expect - parent hangs when child dies
 
Greetings!

I have an expect program that calls
Code:

set ftpChildPID [exec trafficAux &]
then after sometime calls

Code:

exec kill -HUP $ftpChildPID
the child process (also written in TCL/expect)

Code:

trap {
        set isdone 1
} SIGHUP

the intention is to send the child process a signal and allow the child to exit gracefully.

Currently when this code is executed, the child exits gracefully and then the parent process becomes unresponsive.

Any thoughts?


steve

indienick 03-27-2007 08:44 PM

Would you be at all willing to share more of the code? So as we can get a better idea of what is going on?

As for now, try passing a sleep call after you kill the child. Something like "sleep 3".

My dad does alot of Expect scripting, and he has to throw those in all over the place to keep the script from getting ahead of itself; force the program flow.


All times are GMT -5. The time now is 11:37 AM.