Program to log off idle users

James E. Leinweber jiml at uwslh.slh.wisc.edu
Thu Oct 11 03:03:43 AEST 1990


james at dlss2.UUCP (James Cummings) writes:
>I wrote, and haven't finished smoothing out some
>of the edges on, a C implementation that looks directly at the utmp file
>for struct utmp.ut_type equal to "7"(a USER_PROCESS) and guages time by
>calling stat() against the utmp.ut_line (tty line) for last modified time.

Utmp and the actual terminal line aren't always a good judge of
idleness.  We run the "assassin" program (BSD systems only, posted a
few years ago) here, and we had to tell it to ignore kermit.  Our
version of kermit opens /dev/tty for its I/O, and a furiously active
transfer of a large file looks quite idle by any easy measure except
CPU activity.  I have grave doubts that there is any general way of
distinguishing idle users from unusual ones, at least in environments 
with distributed computations containing delays.  A typical thing here is
to start a kermit session between two minicomputers, with the local end idle
while the remote end generates the file to be transfered, followed by
the transfer.  If anyone can tell me how to tell that from an idle user, I'd
be amazed.
-- 
Jim Leinweber  (608)262-0736   State Lab. of Hygiene/U. of Wisconsin - Madison 
jiml at sente.slh.wisc.edu	       uunet!uwvax!uwslh!jiml        fax:(608)262-3257



More information about the Comp.unix.admin mailing list