shell tricks and trapping signals

Paul Lussier p.lussier at comcast.net
Fri Nov 2 11:13:22 EDT 2007


Since we're on the topic of shell tricks, does anyone know of a way to
trap on a processes PPID getting re-parented?

By way of example:

-  Our test infrastructure initiates an ssh session to a remote machine.
-  On the remote machine, a process is spawned.
-  At some timeout, the ssh session is terminated, effectively
   orphanning the process it spawned.
-  The spawned process is re-parented to PID 1 (init).
-  I want to trap on this, cleanup, and exit.

Any ideas on how?
-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list