shell tricks and trapping signals

Ben Scott dragonhawk at gmail.com
Fri Nov 2 13:28:59 EDT 2007


On 11/2/07, Paul Lussier <p.lussier at comcast.net> wrote:
> The ssh tunnel can collapse, and any spawned process is essentially
> orphanned to be reparented by init.  We want the spawned process to
> trap on that re-parenting.

  I don't think children receive a signal when a parent process exits,
and I cannot find anything about that documented in the signal(7) man
page.  A parent process receives SIGCHLD when a child exits, but not
the other way around.

  Would a heartbeat mechanism be feasible?  In other words, have one
process emit an "I'm still here" keep-alive periodically, and have the
process at the other end of the SSH tunnel kill itself if it doesn't
get a command within the timeout period.

-- Ben


More information about the gnhlug-discuss mailing list