You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by Bala Ayres <ba...@cisco.com> on 2001/10/02 00:21:58 UTC

Re: exec

You must reap child processes after they complete
Include the following line after [exec ...]
wait $sim

It will work

Bala

"David N. Welton" wrote:

> Ilic Aleksandar <fl...@gavrilo.elfak.ni.ac.yu> writes:
>
> > Hi, I have problems with execiting .tcl scripts from .ttml. I use
> > exec to start :
>
> > It's working fine, but that script (simulator.tcl) might need
> > several hours for execution:( and I want my ttml just to start
> > simulator and send it to background. I try with
>
> > catch {
> > set sim [exec ./simulator.tcl $VARS(proj_id) $VARS(ver) &]
> > }
>
> That looks correct
>
> > but after that simulator.tcl always becoming zombie process. Can
> > anybody help me with this?
>
> A zombie?  Are you sure?  What happens if you try launching it from a
> regular tclsh that way?
>
> #!/usr/bin/tclsh
>
> catch {
> set sim [exec ./simulator.tcl $VARS(proj_id) $VARS(ver) &]
> }
>
> exit
>
> And check its status...
>
> --
> David N. Welton
>    Consulting: http://www.dedasys.com/
> Free Software: http://people.debian.org/~davidw/
>    Apache Tcl: http://tcl.apache.org/
>      Personal: http://www.efn.org/~davidw/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: mod_dtcl-unsubscribe@tcl.apache.org
> For additional commands, e-mail: mod_dtcl-help@tcl.apache.org


Re: exec

Posted by "David N. Welton" <da...@dedasys.com>.
Bala Ayres <ba...@cisco.com> writes:

> You must reap child processes after they complete Include the
> following line after [exec ...]

> wait $sim

wait doesn't exist in standard tcl, only vwait, but that's for a
different purpose.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Re: exec

Posted by Wojciech Kocjan <wo...@kocjan.org>.
Zombies will stay. Tcl always reaps child processes, but probably after
these hours the Apache process which launched the children no longer
exists - that is why it cannot cleanup its child.

You might try tclsh, use TclX in the script and then do [fork] in Tcl
(but outside httpd process). This may help. If not, then I'm almost out
of ideas.

--
WK