SIGKILL to pty master



Apparently, my understanding of the process
model is completely wrong. :(

A process forks. The parent pauses, the
child forks and pauses, the grandchild pauses.
Suppose this was executed from an interactive
shell on a pty (eg running in konsole or screen).
If I send a SIGKILL to the shell, all of the
processes are terminated. However, if the shell
was running on a virtual terminal, the processes
continue to run after the death of the shell.

I believe that what is happening is that the
shell's death causes the pty to be destroyed,
which causes a signal to be sent to the
foreground process group that is attached
to the pty. Is that correct? The behavior
that interests me is the termination of
the descendants in the face of the SIGKILL.
I'd like to emulate this behavior: that is,
I'd like a process to be able to have many
children, and guarantee that all the children are
terminated if the process receives a SIGKILL.
It looks like I could emulate that by opening
a pty and ensuring that all of the descendants
remain in the foreground process group. That,
however, seems like a massive kludge. Is there
an easier way? Any tips appreciated.

--
Bill Pursell

.



Relevant Pages

  • Re: SIGKILL to pty master
    ... child forks and pauses, the grandchild pauses. ... shell on a pty. ...
    (comp.os.linux.development.apps)
  • Re: How to tell the end of a shell
    ... As soon as I call the shell, I run a subroutine ... which essentially pauses the main program for a few seconds whilst the ... I then use VB to open Word and read the newly ...
    (microsoft.public.vb.general.discussion)
  • Re: How to tell the end of a shell
    ... As soon as I call the shell, I run a subroutine ... which essentially pauses the main program for a few seconds whilst the ... I then use VB to open Word and read the newly ...
    (microsoft.public.vb.general.discussion)
  • How to tell the end of a shell
    ... I have a VB6 program which runs shell which runs another program which in turn creates a file. ... As soon as I call the shell, I run a subroutine which essentially pauses the main program for a few seconds whilst the new file is created. ... I then use VB to open Word and read the newly created file. ...
    (microsoft.public.vb.general.discussion)