Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!crdgw1!barnett From: barnett@grymoire.crd.ge.com (Bruce Barnett) Newsgroups: comp.unix.misc Subject: Re: Who's in my Directory ? Message-ID: Date: 30 Nov 90 16:46:48 GMT References: <1990Nov21.013355.16798@maverick.ksu.ksu.edu> <1990Nov21.185812.19152@athena.mit.edu> <109418@convex.convex.com> Sender: news@crdgw1.crd.ge.com Reply-To: barnett@crdgw1.ge.com Organization: GE Corp. R & D, Schenectady, NY Lines: 39 In-reply-to: tchrist@convex.COM's message of 28 Nov 90 20:14:10 GMT In article <109418@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: >In article , >barnett@crdgw1.ge.com scrawls: (p.s. I apologize for the bad handwritting. You should see what it looks like when I don't use a keyboard! :-) >>This only works is a processes current working directory is visible >>with a ps wweuax command. >Sorry, but very few programs keep your cwd in the $PWD envariable. So >this won't work very often. I would still go with fuser for SysV boxes, >fstat for BSD ones, or ofiles if you can't find any better. Yeah - I know. But I wanted to post something that sometimes works and doesn't require any special program. No one else posted a shell only "solution". Unmounting a file system in an emergency is a tough problem if you use talk(1), wall(1), and the telephone - and the guy doesn't answer. I used the above script to detect and the force program to change someone's current directory, if I could. (Force is a program by jjg@linus.UUCP (Jeff Glass) that I got from comp.sources.misc. It uses the TIOCSTI ioctl). If not - the kill command is sure to get their attention. :-) I looked at your script, and it doesn't quite work on my Sun4. the SZ field can be 4 characters wide, and runs into the NI field: F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND 80012067 6958 6957 32 33 02056 2680 R co 16:39 process I am willing to work on a perlized version of the above, but Tom is a zillion times better than I am with perl. (Tom - send me e-mail if you want to continue this). -- Bruce G. Barnett barnett@crd.ge.com uunet!crdgw1!barnett