Waiting on parents and reinstating HUP
Jonathan I. Kamens
jik at athena.mit.edu
Thu Apr 25 07:51:12 AEST 1991
In article <1991Apr24.150154.19539 at minyos.xx.rmit.oz.au>, s902255 at minyos.xx.rmit.oz.au (Andrew Vanderstock) writes:
|> Best way to ensure that all processes die when a user logs out is to
|> alias logout to 'kill -1 -9'.
Are you sure you don't mean 'kill -9 -1'. I don't know of any system that
treats '-9' as a special PID, but I know '-1' works on many systems.
And isn't it better to use 'kill -HUP -1'? If the original user was trying to
guarantee that background processes got HUP signals, it seems silly me to use
signals that are stronger than the HUP signal.
Finally, note that, as far as I know, using that will guarantee a signal
delivered to every process owned by the user *except* the process from which
the signal was sent. If he's using a login shell with a built-in 'kill', this
means that his login shell won't get the signal and he won't be logged out.
You have to be careful about this.
--
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik at Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8085 Home: 617-782-0710
More information about the Comp.unix.programmer
mailing list