From owner-freebsd-questions@FreeBSD.ORG Sun Apr 11 12:12:01 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3FC1106564A for ; Sun, 11 Apr 2010 12:12:01 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 65B508FC18 for ; Sun, 11 Apr 2010 12:12:00 +0000 (UTC) Received: by wwb24 with SMTP id 24so1665392wwb.13 for ; Sun, 11 Apr 2010 05:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=zntve02PLMnFUpKpiUPzGvMnmF6nLPDJYPpQ9hK5E1g=; b=BUiIFHSOoz2GRRid4lFFvZ+Zhhkog/O2oY9/R3oww9cfGZVbhws9DSbj/BfjfTmQjr gNLwQVQOnQ6dSTeww7Jo0x6oFC93PY9wwCMYjKdHTp33O6LTYKVZZrOIClADabVh+vaw k6i3lALtnr3FekEBByyImrjfcPWeSYLWtd88w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=Kg6qoL/aNQB+6lO2O4LlrneM6DgjqLSPfznzK+dauSiUmexsm78pKKYcfKqWdRew0r HhBW0WoEGf17e6jD7r3wP2nfznokPiu53YHdODXIgncsN3vHxbf8vCUSzfWfrojsid2B c4v2zC/Arkx9iHBgTvZDkkmy5u6gX9i92YqKo= Received: by 10.216.158.1 with SMTP id p1mr1432748wek.202.1270987920227; Sun, 11 Apr 2010 05:12:00 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id q9sm2262057gve.14.2010.04.11.05.11.58 (version=SSLv3 cipher=RC4-MD5); Sun, 11 Apr 2010 05:11:59 -0700 (PDT) Date: Sun, 11 Apr 2010 13:11:57 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20100411131157.2858234d@gumby.homeunix.com> In-Reply-To: <4BC1972B.1080603@webrz.net> References: <4BC168D8.7080900@webrz.net> <4BC1972B.1080603@webrz.net> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Auto update X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 12:12:01 -0000 On Sun, 11 Apr 2010 11:32:27 +0200 Jos Chrispijn wrote: > > On 11-4-2010 9:41, Doug Hardie wrote: > > A cheesy way to do that is to use a popen ("tail -f > > /var/log/auth.log", "r") and then read that. It will give you every > > login regardless of ssh, telnet etc. You could then generate the > > emails from that. I have no idea just how resource intensive this > > might be. You would also have to ensure it got started by rc during > > boot._______________________________________________ > > In order to find out if someone logged in, I should then first copy > auth.log to auth2.log, and do a compare and then do the tail trick. > Have to cron that every half a minute. > I would like to know if there is something that is alterted on the > moment that someone logs on thus forcing evt. your tail suggestion tail -f *is* event driven. When a new line is appended to auth.log, tail will output it. You should probably use $ tail -F -n 0 /var/log/auth.log