Program to log off idle users

Nicole Delbecque & Paul Bijnens FFAAC09 at cc1.kuleuven.ac.be
Fri Oct 12 02:26:14 AEST 1990


>>The trouble with all these idle timeout schemes is that they rely on the idle
>>time on the particular /dev/tty device.
>>
>>1) You don't really want to kill all such sessions, what about people who jus
>> ...
>>2) This just doesn't work.  If an application is talking to /dev/tty instead
>>of the particular port, it's the times on /dev/tty, not /dev/tty?? that get
>>updated.  Our most popular editor round here works like this.  Even the ones
>>that try to be clever and go hunting down the process list looking for busy
>>processes don't work, after 127 seconds you can't tell how long a process has
>>been idle:

>...
>What I do now that seems to work is to use a hacked version of csh
>which has a timeout if it sits at the prompt too long.  The timeout is
>set by a variable in the user's environment.

If you don't have sources, this little Bourne-shell program, called
"alive" can help sometimes (execute it from the /dev/tty??? in question):

    # alive  --  give signes of life on this terminal
    if [ -z "$MYTTY" ]
    then       # fork into the background
        cd /
        MYTTY=`tty`; export MYTTY
        nice -19 $0 $* &
        exit 0
    fi
    while touch -m $MYTTY
    do sleep ${1:-3600}
    done

>                                        In addition I run an
>idlekiller of the sort described in the original article about 3 times
>a day -- once after most people have gone home and once just before
>they arrive for the day and once after midnight.  This catches the
>forgetful emacs users.

Yes, a good advice: if you want to run that idle-killer, give it
a real long permitted idle-time, or don't run it at all.
--
Polleke



More information about the Comp.unix.admin mailing list