Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Sep 2000 12:42:36 -0700 (PDT)
From:      Dima Dorfman <dima@unixfreak.org>
To:        Mohan Khurana <mkhurana@andrew.cmu.edu>
Cc:        questions@freebsd.org
Subject:   Re: How to remove old utmp entry?
Message-ID:  <20000904194236.A37831F17@static.unixfreak.org>
In-Reply-To: <Pine.SOL.3.96L.1000904145144.2734A-100000@unix4.andrew.cmu.edu> from Mohan Khurana at "Sep 4, 2000 03:05:28 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <dima@unixfreak.org>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000904194236.A37831F17>