From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f38af7259640f04 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-21 15:23:56 PST Path: gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!torn!news.unb.ca!coranto.ucs.mun.ca!tony From: tony@engr.mun.ca (Tony Galway) Newsgroups: comp.unix.osf.osf1 Subject: Re: Killing processes on hangup Date: 21 Mar 1994 23:23:56 GMT Organization: C-CAE, Memorial University of Newfoundland Message-ID: <2mlaac$60j@coranto.ucs.mun.ca> References: <2m9kdv$ald@email.tuwien.ac.at> <2mgiho$j7a@irz401.inf.tu-dresden.de> Reply-To: tony@engr.mun.ca NNTP-Posting-Host: borg.engr.mun.ca X-Newsreader: NN version 6.5.0 #14 (NOV) hs3@irz.inf.tu-dresden.de (Hans-Peter Stoerr) writes: >> Is there a way to automatically kill all processes left behind >> on logout? >If Your users use csh or tcsh, you may put something like >kill `ps -x | tail +2 | gawk '{print $1}'` >in their standard .logout This unfortunately is not really a very good solution. We have the same problem here, and looks like we are going to have to write a program/script, something to take care of this. tin, nn, vi ... programs such as these should always have a terminal associated with it, however there are also programs that should be run in the background. We have users placing massive abaqus, ansys, matlab, and private programs in the background that should not be killed. You might consider creating a program/script that has a file that contains those programs that should NOT be separated from their ttys, and grep for those searching to see if ?? appears in the TT field, so for example, ps aux | grep nn | awk '{if ($7 == "??") {print $2}}' | xargs kill -HUP ( or TERM or KILL <-- my favorite .. works all the time :) ) would search for all "nn" sessions and kill off those that have ?? in the TT field. This is a little unwieldy, but its probably easiest, if anyone has a better sugestion, I am all ears. -Tony -- Tony Galway Life is what happens while you're C-CAE |\_/| making other plans. Memorial University (` ') tony@engr.mun.ca | |