*BSD News Article 44961


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.uwa.edu.au!classic.iinet.com.au!news.uoknor.edu!news.ecn.uoknor.edu!paladin.american.edu!gatech!howland.reston.ans.net!nntp.crl.com!pacbell.com!nntp-hub2.barrnet.net!news3.near.net!jericho.mc.com!jericho!gwr
From: gwr@mc.com (Gordon W. Ross)
Newsgroups: comp.unix.bsd
Subject: Re: Idle time...
Date: 29 May 1995 03:27:40 GMT
Organization: Mercury Computer Systems, Inc.
Lines: 22
Message-ID: <GWR.95May28232740@bach.mc.com>
References: <3ptaia$88r@linet02.li.net>
Reply-To: "Gordon Ross" <gwr@mc.com>
NNTP-Posting-Host: bach.mc.com
In-reply-to: louis@scls1's message of 23 May 1995 18:46:34 GMT

In article <3ptaia$88r@linet02.li.net>
 louis@scls1 (Louis A. DeRobertis) writes:

> From: louis@scls1 (Louis A. DeRobertis)
> Newsgroups: comp.unix.bsd
> Date: 23 May 1995 18:46:34 GMT

> Can anyone think of a quick/easy way to logout a user that has
> been idle for X amount of minutes?

The usual way is to run a program which scans all the tty lines
at some interval (say every minute) and does a stat on the tty
device for each one.  The "last modified" time is the last time
something was written on the tty, and the "last accessed" time
is the last time something was read from the tty.  The latter
may be used by an "auto logout daemon" to measure inactivity.

--
Gordon W. Ross			  Internet: <gwr@mc.com>
Mercury Computer Systems	Voice mail: 508-256-0052x295
199 Riverneck Road		Front desk: 508-256-1300
Chelmsford, MA 01824-2820	 Facsimile: 508-256-3599