Hi,
Does anybody know of a solution for killing a csh background process
**AND** any unfinished processes (fg and background) it started.
I know you guys think tcsh sucks but translating the csh code to bash is
not trivial task because of it's large volume of the case I have at
hand.
I should mention that when the csh script is started in the foreground
on a terminal and I do a ^C it behaves excellent in that it exits and
all the processes it started exit.
Things I considered (and didn't work for me):
* Use the -q option of csh and kill with a signal: QUIT (3). Only
kills the shell but not a process started by the shell in the
foreground (actually another csh).
* Use the csh onintr command and when interrupt time arrives the
processes will be killed with signal INT (2) before the script
exits. The same for the processes started. With the many scripts
this becomes unfeasible. I'm hoping to add a line or two to each
script, max.
* Use the tcsh hup command and kill with a signal: HUP (1). Again,
the process started by tcsh in the fg doesn't finish.
* Set limits on cpu usage. Ugly and insufficient because a process
might not take cpu but still get left behind.
After this mess is solved, I'll try to hook this all up to Python;-) And
never code in csh again?
Thanks for your time,
Jurgen