tcl/TK question

Jerry Feldman gaf at gapps.blu.org
Thu Jun 16 11:02:55 EDT 2011


I am using a tcl/tk script to serve as a GUI for an existing BASH
system. Essentially, most of the buttons go through a single command
processor in tcl.
I set up a command as "script name <command - from the button pressed>
<command options>"
The code is:
if [catch {open "|$command |& cat"} input] {
.....

The script I call is a wrapper BASH script that calls another script to
do the work.
For simplicity, I have a start and stop script. The start script starts
a number of services including Apache Tomcat and other background
processes. It then exits, and the wrapper script exits. The stop script
simply stops all the background processes.
One issue is that I do not get an EOF on the input file and it looks
like the cat is still running:
13501 pts/3    Z      0:00 [wrapper] <defunct>
13502 pts/3    S      0:00 cat

The stop script does run successfully and detects the EOF on the open
channel. After stop completes processes 13501 and 13502 are zombies, but
the processes created by the stop exit properly.
In C I can easily prevent zombies by either handling the SIGCHLD signal
or waiting until complete. I'm not overly concerned about the zombies,
but I am about not detecting EOF on the files.

One other issue that may or not be related is that sometimes the tcl/tk
script hangs, but I might have caused this with my debugging.

-- 
Jerry Feldman <gaf at gapps.blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20110616/894ebbcf/attachment.bin 


More information about the gnhlug-discuss mailing list