From owner-freebsd-questions Mon Sep 4 12:42:39 2000 Delivered-To: freebsd-questions@freebsd.org Received: from static.unixfreak.org (static.unixfreak.org [63.198.170.139]) by hub.freebsd.org (Postfix) with ESMTP id 7DE8337B422 for ; Mon, 4 Sep 2000 12:42:37 -0700 (PDT) Received: by static.unixfreak.org (Postfix, from userid 1000) id A37831F17; Mon, 4 Sep 2000 12:42:36 -0700 (PDT) Subject: Re: How to remove old utmp entry? In-Reply-To: from Mohan Khurana at "Sep 4, 2000 03:05:28 pm" To: Mohan Khurana Date: Mon, 4 Sep 2000 12:42:36 -0700 (PDT) Cc: questions@freebsd.org From: Dima Dorfman Reply-To: dima@unixfreak.org X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20000904194236.A37831F17@static.unixfreak.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Dear questions, > > I have a system that appears to have an entry that is stale, and I was > hoping someone could shed some light as to how to remove the entry. > > # w > 2:38PM up 117 days, 2:57, 2 users, load averages: 0.15, 0.08, 0.03 > USER TTY FROM LOGIN@ IDLE WHAT > root p0 shelly.metachar. 2:32PM - w > root p1 hindu.ny.razorfi 22Jun00 73days - > > So the problem here is that the user root on tty p1 is no longer logged > in, yet it still appears as output from the w program. From the man > page, I learned that I can do "w -d" for it to list processes as well, and > it is confirmed, there are no processes running as root on tty p1. I > checked the process list using ps as well, and I was unable to find any > processes associated with root on tty p1. I am running FreeBSD > 3.3-RELEASE. Does anyone know of any way to remove that stale utmp > entry? Take a look at http://www.unixfreak.org/~dima/files/logout.c. It does just that. Download it, compile it (`cc logout.c -o logout -lutil`), and run it (in your case, `./logout ttyp1`). If you have any problems please let me know. Enjoy! -- Dima Dorfman Finger dima@unixfreak.org for my public PGP key. "The best way to keep one's word is not to give it." -- Napoleon Bonaparte To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message