Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-27-2007, 12:08 PM   #1
Registered: Feb 2007
Location: /home
Distribution: Kubuntu and CentOS
Posts: 214

Rep: Reputation: 32
TCL/expect - parent hangs when child dies


I have an expect program that calls
set ftpChildPID [exec trafficAux &]
then after sometime calls

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

trap {
        set isdone 1
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?

Old 03-27-2007, 08:44 PM   #2
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a parent to communicate with its child -- fork() kamel Programming 3 06-02-2004 03:04 AM
parent and child processes skora Programming 5 11-02-2003 10:41 AM
about parent and child process winwar Solaris / OpenSolaris 3 07-23-2003 06:07 AM
child and parent process error jdevanand Programming 1 04-29-2002 08:13 AM
child-parent-&-fork mukul Programming 2 03-24-2001 01:12 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration