From owner-freebsd-questions@FreeBSD.ORG Sat Feb 21 17:27:58 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E05701065678 for ; Sat, 21 Feb 2009 17:27:58 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id 6778E8FC21 for ; Sat, 21 Feb 2009 17:27:58 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1Lavdp-0005ro-UL; Sat, 21 Feb 2009 17:27:53 +0000 Received: from melon.esperance-linux.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.14.1/8.14.1/Debian-9) with ESMTP id n1LHRrPm011147; Sat, 21 Feb 2009 17:27:53 GMT Received: by melon.esperance-linux.co.uk (Postfix, from userid 1001) id 41D5CFCA4DB; Sat, 21 Feb 2009 17:27:48 +0000 (GMT) Date: Sat, 21 Feb 2009 17:27:48 +0000 From: Frank Shute To: Anton Shterenlikht Message-ID: <20090221172748.GA71010@melon.esperance-linux.co.uk> References: <20090217134330.GA53766@mech-cluster238.men.bris.ac.uk> <946140ad0902170602v5d41eab5hf63a489476e663b6@mail.gmail.com> <20090217145446.GA55629@mech-cluster238.men.bris.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090217145446.GA55629@mech-cluster238.men.bris.ac.uk> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 6.4-RELEASE-p2 i386 X-Organisation: 'http://www.shute.org.uk/' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.1.7 (zetnet.co.uk [194.247.46.1]); Sat, 21 Feb 2009 17:27:53 +0000 (GMT) Cc: Randy Belk , questions@freebsd.org Subject: Re: w(5) shows non-existent or lost process? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 17:28:02 -0000 On Tue, Feb 17, 2009 at 02:54:47PM +0000, Anton Shterenlikht wrote: > > On Tue, Feb 17, 2009 at 08:02:12AM -0600, Randy Belk wrote: > > On Tue, Feb 17, 2009 at 7:43 AM, Anton Shterenlikht wrote: > > > The who (or w, or finger) command shows that I'm still logged into ttyp5, > > > even though I have rebooted the box many times since. Does this mean > > > the corresponding entry in /var/run/utmp is wrong and shouldn't be there, or is there > > > still some process attached to ttyp5? > > > > > > ouput of w: > > > > > > USER TTY FROM LOGIN@ IDLE WHAT > > > mexas p4 1:32pm - w > > > mexas p5 :0. 26Jan09 21days - > > > > > > ps ax | grep ttyp5 > > > shows no process > > > > > > Looking at w(1) man page it seems that "-" in WHAT can be an indication > > > that the process failed but not cleanly and that there could be some forked > > > sub-process still alive. Does this make sense? Which other commands I can use > > > to see what's going on? > > > > > > > LSOF is your friend! The port is located in /usr/ports/sysutils/lsof > > To find out what is using ttyp5 type in "lsof | grep ttyp5" and it > > should show you the process > > # lsof |grep ttyp5 > # > > this is 6.4-stable alpha which might not be fully supported by lsof, > according to the man page. Anything else I can try? I'm not sure why everybody recommends lsof for these sorts of problems when fstat(1) does pretty much the same thing! Glad you got your problem sorted anyway. > > many thanks > anton > Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html