From owner-freebsd-questions Fri Nov 22 18: 5:21 2002 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 B652937B401 for ; Fri, 22 Nov 2002 18:05:19 -0800 (PST) Received: from titanjr.blacktrap.net (212.68.218.22.brutele.be [212.68.218.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 198D943E3B for ; Fri, 22 Nov 2002 18:05:08 -0800 (PST) (envelope-from oli@titanjr.blacktrap.net) Received: from titanjr.blacktrap.net (localhost [IPv6:::1]) by titanjr.blacktrap.net (8.12.6/8.12.6) with ESMTP id gAN25Z9F039187; Sat, 23 Nov 2002 03:05:35 +0100 (CET) (envelope-from oli@titanjr.blacktrap.net) Received: (from oli@localhost) by titanjr.blacktrap.net (8.12.6/8.12.6/Submit) id gAN25XbE039186; Sat, 23 Nov 2002 03:05:33 +0100 (CET) Date: Sat, 23 Nov 2002 03:05:33 +0100 From: Olivier To: Jimmy Olgeni Cc: freebsd-questions@freebsd.org Subject: Re: How to monitor user commands Message-ID: <20021123020533.GB38745@titanjr.blacktrap.net> References: <20021121155159.GA36762@titanjr.blacktrap.net> <20021121182954.V62985-100000@dev1.localdomain.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021121182954.V62985-100000@dev1.localdomain.net> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Nov 21, 2002 at 06:31:14PM +0100, Jimmy Olgeni wrote: > > On Thu, 21 Nov 2002, Olivier wrote: > > > Is there any tool in the ports that could do that? Or has anybody done > > any script or something that would help me? > > Check out the "script" command, which would allow you to log the users > terminal sessions. The "watch" command allows you to watch the users > in real time, while the csh shell should have some support for > login/logout notification, even if I couldn't figure out how to enable > it :o) > > -- > jimmy Thanks a lot jimmy and axel ;-) * 'script' could do the job, I thought about putting something like script -q "/tmp/logging/$USER.`date "+%d-%m-%Y.%H:%M:%S"`" in /etc/profile, so ok the user doesn't notice she's in a forked shell, until she needs to exit it. Then a double 'exit' is needed, so that will show her something is wrong, and nothing prevents from doing stuff after typing the first 'exit'.. Is there a better way to do this with 'script'? * 'watch' sounds very nice, but I need to be connected at the same time, thus need a reliable way to get notified about a bash login? Or is it supposed to be used by launching a couple of watch processes, each snooping one of the ttyp's? That would work I guess, maybe piped into gzip. BTW, shouldn't the warn(8) man page warn that /dev/snpX devices needs to be MAKEDEV'd first? But it's probably just me, I am really skilled at missing important info in the doc ;-) Thank you again for your help.. Olivier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message