Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Feb 2001 19:14:08 -0800
From:      Dima Dorfman <dima@unixfreak.org>
To:        jim@freeze.org
Cc:        questions@freebsd.org
Subject:   Re: Mysterious user 
Message-ID:  <20010212031408.8C1103E09@bazooka.unixfreak.org>
In-Reply-To: Message from jim@freeze.org  of "Sun, 11 Feb 2001 19:24:21 EST." <200102120024.TAA08765@CI590846-B.lxintn1.ky.home.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Nope. The ctrl+d did not close the terminal.
> Now I have

I'm not sure I really understand your question; are you trying to
figure out why this happened, or how to get rid of it?  It seems the
former has already been answered for you.

If you want to get rid of it, there are two ways.  The first is to
establish enough connections so one ends up on ttyp7, then gracefully
close all of them; the second is to compile and run this program,
which takes the terminal name as an argument, and removes the
corresponding utmp entry (`./progname ttyp7`, for example).  Compile
it using `gcc -pipe -o whatever whatever.c` (obviously replace
whatever[.c] with whatever you called it).

Hope this helps

					Dima Dorfman
					dima@unixfreak.org

/* start whatever.c */
#include <sys/types.h>
#include <err.h>
#include <libutil.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{

	if (argc < 2)
	{
		printf("Usage: %s <tty>\n", argv[0]);
		return (1);
	}

	if (logout(argv[1]) != 1)
		err(1, "logout");
	else
		printf("utmp entry for %s has been cleared\n", argv[1]);

	return (0);
}
/* end whatever.c */


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?20010212031408.8C1103E09>