From owner-freebsd-questions@FreeBSD.ORG Thu Oct 9 06:09:31 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB38716A4B3 for ; Thu, 9 Oct 2003 06:09:31 -0700 (PDT) Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [66.30.200.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2659143F93 for ; Thu, 9 Oct 2003 06:09:31 -0700 (PDT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id A300D3AF6; Thu, 9 Oct 2003 09:09:30 -0400 (EDT) Sender: lowell@be-well.ilk.org To: Lukasz Wasikowski References: <20031008004255.L48093@kochana.org> From: Lowell Gilbert Date: 09 Oct 2003 09:09:30 -0400 In-Reply-To: <20031008004255.L48093@kochana.org> Message-ID: <44pth6eewl.fsf@be-well.ilk.org> Lines: 31 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-questions@freebsd.org Subject: Re: Logging users activity with termlog X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2003 13:09:31 -0000 Lukasz Wasikowski writes: > FreeBSD 4.9-RC. termlog 1.0.2-STABLE. I want to log users activity on my > box. > > 1. I'd like to run termlog -u UID as soon as user with UID log in. How > should I do it? I don't think there are any great answers there. The easy hack is to mess with login scripts, but that would be visible to the user (if they checked). For a fair amount of extra effort, you could hack it into login(1) itself. > 2. I noticed that running "screen program" and then leaving it (quit, not > detach) makes termlog to quit with: > > termlog: fatal: unable to poll device.: Bad file descriptor > > User is still logged in. The same quit reason is when user don't use > screen and logout. What's wrong? > > 3. -t switch should put timestamps in the output file but it doesn't. > Files created with -t and without it are identical. Those are problems specific to "termlog"; since I never heard of it until now, I don't know much, but on the first I would guess that it's not opening the "real" terminal line. > Maybe there is a better way to log users activity? Did you look at the watch(8) utility in the base system?