Abandoned shell

andrew.b.myers abm at cbnewsm.att.com
Tue Dec 11 12:48:21 AEST 1990


In article <1990Dec9.020043.273 at cbnewsm.att.com>, abm at cbnewsm.att.com (andrew.b.myers) writes:
> 
> What's the best sure-fire way to kill a login shell instantaneously
> if a user disconnects "ungracefully"?  I'm sure anyone who knows
> anything about system administration can help me.  I just don't
> happen to know anything about system administration.
> 
> [description of the problem deleted...]
> -- 
> ========================================================================
>  Andrew Myers            AT&T, Basking Ridge, NJ     ...attmail!abmyers
>  Public Relations             201-221-2737            ...att!brpr04!abm
> ========================================================================

I am following up to my original ariticle to let you all know a
fix has been found.  The operative advice came from Tom Gillespie
(tag at mtunf.att.com) who suggested I try setting a trap to cause the
shell to commit suicide upon hangup.  Simple fix, and it works fine.

For those who asked me to let them know if I found a fix, just put
this in the user's .profile or (as I did) within the shell script
itself:  trap "kill -9 0" 1

This issues a large sledged hammer kill on the parent and all child
processes upon detection of SIGHUP (Signal 1).

I erred in saying earlier that Mr. "go" was still logged in.  What I
saw was an active abandoned rsh when I checked with ps -ef.  A who -a
indicated the user was not logged in.  Thus the problem wasn't with the
modem at all.  In fact, I was able to duplicate the abandoned shell
behavior using another hardwired port.  The modem works fine.  For those
who asked, the switch 6 was set UP and properly dropped DSR upon hangup.

Thanks very much to all those who responded!  This damned net is
fantastic.

--andy myers--
-- 
========================================================================
 Andrew Myers            AT&T, Basking Ridge, NJ     ...attmail!abmyers
 Public Relations             201-221-2737            ...att!brpr04!abm
========================================================================



More information about the Comp.unix.admin mailing list