[comp.unix.questions] idle time

kchiu@carina.unm.edu (08/09/90)

	Hello, I have a question, How do you set your IDLE time on the UNIX
so the computer won't log off if you are idle for too long?  I don't usally
read this group, so please send all your replies to:

		kchiu@carina@unm.edu

							Thanks.

dkpsy121@nmt.edu (Master Bater) (04/17/91)

I need some help in trying to get the idle time of a user on a tty in C, kinda
like the way finger does...

UTMP does not seem to hold the information I am looking for.

Any help would be appreciated...


-Dino Khoe
dkcs122@minos.nmt.edu

jpm@logixwi.uucp (Jan-Piet Mens) (04/17/91)

dkpsy121@nmt.edu (Master Bater) writes:


>I need some help in trying to get the idle time of a user on a tty in C, kinda
>like the way finger does...

>UTMP does not seem to hold the information I am looking for.

	Try having a look at the modification times of the user's 
	/dev/tty* file.

Regards,
	-JP
-- 
Jan-Piet Mens, Logix GmbH				    jpm@logixwi.UUCP
Moritzstr. 50, D-6200 Wiesbaden            ...!uunet!mcsun!unido!logixwi!jpm

clewis@ferret.ocunix.on.ca (Chris Lewis) (04/19/91)

In article <1991Apr17.024209.1056@nmt.edu> dkpsy121@nmt.edu (Master Bater) writes:

>I need some help in trying to get the idle time of a user on a tty in C, kinda
>like the way finger does...

Look at the access or modify time on the serial port that the user is logged
into.  One of these will be the last time that a key was hit.  Approximately.
On most systems.
-- 
Chris Lewis, Phone: (613) 832-0541, Internet: clewis@ferret.ocunix.on.ca
UUCP: uunet!mitel!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!

guy@auspex.auspex.com (Guy Harris) (04/20/91)

>	Try having a look at the modification times of the user's 
>	/dev/tty* file.

Try having a look at the *access* time instead; that's the way all the
programs *I* know of that find "idle time" do it (the theory is that
they want the *user's* idle time, i.e. the time since they last asked
the system to do something, and the access time on the tty device gets
updated whenever a "read()" completes on that device, i.e. when
something to read becomes available because the user typed it).