From: Sam Roberts Date: 2006-06-05T14:20:26+09:00 Subject: Re: Please kill the children as you're leaving Quoting garbagecat10@gmail.com, on Mon, Jun 05, 2006 at 10:02:30AM +0900: > >>>Non with irb, but you may be able to make the parent a session leader, > which might cause SIGHUP to be delivered to its children when it exits. > > If a process becomes a process group leader (setpgid(0,0) in the child > process after the fork and before it calls exec), then its parent can kill > it and all of its subprocesses by sending a signal to the negative of its > pid. Not sure that helps here though. The best idea I've heard so far is for Advance Programming in the Unix Environment, p.267 (R. Stevens) says: SIGHUP .... This signal is also generated if the session leader terminates. In this case, the signal is sent to each process in the foreground process group. It sounds like it should be possible to arrange for sighup to be sent to an entire process group automatically if the session leader terminates. Cheers, Sam