Is it possible to set up 2 applications so that the first will signal(?) the
second when it terminates?
I realize that in the case of a process forking a child process this happens
automatically in that the child generates a SIG_CHLD which the parent can
handle.
Is there any way to do the same (or similar) thing if there is no parent/child
relation between the 2 processes?
Several things we have thought of include the following:
Have the first process notify the second somehow prior to exiting.
The problem with this is this only works if the first process can control
when it exits. It won't work if, for example, we do a kill -9 on the first
process.
Set up signal handlers to catch all catchable signals and from within the
signal handler, notify the second process.
The problem with this is; what do we do with uncatchable signals.
Periodically poll to see if the process still exists.
Problems with this are that it takes a small amount of time to execute,
and what if the PID is reused?
Any other thoughts would be greatly appreciated. I feel that the solution
will be obvious, and hopefully easy to put in place, but cannot figure what
it might be.
Thanks in advance.
--
Grumman Data Systems
7600 Boston Blvd.
Springfield, VA 22153