[comp.os.msdos.programmer] Terminating processes that have spawned other processes

dsims@uceng.UC.EDU (david l sims) (12/11/90)

Does anyone know of any techniques to use in the following scenario:

Say I'm running a BBS that uses a program like DOORWAY or GATEWAY to
run another program outside the BBS (a door). Now say that the door
runs another program on its own, and then *that* program runs another
program on its own, and so on until we have 6 or 7 processes out there.

Now, say the caller idles too long and GATEWAY wants to hangup on him
and terminate all processes and return to the BBS. I noticed that DOS
function 4Bh or something like that (terminate process) says that it
terminates the *current* process. Well, if we've got 6 or 7 processes
going, that won't get kill all the extra ones and get us back to the BBS.

I hope that anyone who generally knows what I'm talking about has the idea.
Would you share any techniques you might use or know of to solve this
potential problem?

Thanks much.

valley@uchicago (Doug Dougherty) (12/11/90)

dsims@uceng.UC.EDU (david l sims) writes:

>Does anyone know of any techniques to use in the following scenario:

>Say I'm running a BBS that uses a program like DOORWAY or GATEWAY to
>run another program outside the BBS (a door). Now say that the door
>runs another program on its own, and then *that* program runs another
>program on its own, and so on until we have 6 or 7 processes out there.

>Now, say the caller idles too long and GATEWAY wants to hangup on him
>and terminate all processes and return to the BBS. I noticed that DOS
>function 4Bh or something like that (terminate process) says that it
>terminates the *current* process. Well, if we've got 6 or 7 processes
>going, that won't get kill all the extra ones and get us back to the BBS.

>I hope that anyone who generally knows what I'm talking about has the idea.
>Would you share any techniques you might use or know of to solve this
>potential problem?

>Thanks much.

There are no signals in DOS...

The standard solution is to reboot the machine.  Use WATCHDOG.COM.

hughes@locusts.Berkeley.EDU (Eric Hughes) (12/12/90)

dsims@uceng.UC.EDU (david l sims) writes about needing to recursively
terminate a group of processes.

In article <valley.660872074@gsbsun> valley@uchicago (Doug Dougherty) replies:
>There are no signals in DOS...
>The standard solution is to reboot the machine.  Use WATCHDOG.COM.

But if you had to, you could simulate a kill signal with a special
loader program which could terminate its subprocesses.

Let us call this hypothetical program 'killable.exe'.  It would
be run like 'errout' or similar program and exec the command line
which followed it after setting up a vector for interrupt 0x22,
the terminate handler address.  At termination of 'killable' the
termination handler gets control.  'killable' then goes about
killing all its subprocess.

This kind of program could exist, but I don't know if it does; I have
never written one.

I'll bet the watchdog program is more reliable in most circumstances,
though.

Eric Hughes
hughes@ocf.berkeley.edu