    	    			ZAPPER
    				======

			   by Paul Thomsen

Introduction:
-------------

    In the continuiing effort to improve system performance and security, the
new 'ZAPPER' program is a useful and effective tool.

    This function will automatically log any and all users off the system if
they have been logged in without doing any work for a certain period of time.
Thus unattended terminals cannot be used to effect the system in any way, and 
the system's overhead is reduced so that it can do more work to serve the
active users.

    The allowable time period that users can be logged in without doing any
terminal work varies for each application and potentially for each user.  Thus
different users are logged out at different times.  All open files are closed
for the user when he is logged out.

Operation:
----------

    The ZAPPER program looks for all interactive sessions, and deletes those
that have been inactive for too long.  In order to determine how long is too
long, it reads two sequential files containing such information for the users,
or it uses a default pre-programmed time ( 30 minutes ).  The first file is
SYS$SYSTEM:ZAPPER_APPLICATIONS.DAT, which contains image names and how long
users using these images are allowed to be inactive.  For instance, all ADT
users ( training, production, etc. ) run ADTMAIN, and this might have an
inactive time limit of 45 minutes.  The second file will override this file for
specific users that might be exceptional.  This file is called
SYS$SYSTEM:ZAPPER_USERS.DAT.

    These files are read by ZAPPER only when it is first started up, so if
changes are to be made, the files should be edited and the programn then
re-submitted, as follows.  For convenience, the ZAPPER data files are ASCII
sequential files and can be edited with EDT, etc.  The instructions for their
use are within the files themselves.

    In normal operation, ZAPPER maintains a list of users who were on the
system one minute ago.  After 'hibernating' for 1 minute, ZAPPER will wake up
and compare the list to the current situation on the system, updating the list
as it goes.  For each user currently on the system, it will note whether they
have had any activity in the last minute.  If not, it will increase its record
of how long they have been inactive.  At the same time it will check these users
to see if they have now exceeded their allowable inactive periods.  Those that
have will have messages displayed on their screen, as follows.  The time and
date that the user was logged out is also recorded in a log file 
( SYS$SYSTEM:ZAPPER.LOG).  Any time a user is noted to have had activity, his
recorded inactive time is automatically zeroed.  If a user is no longer on the
system, he will be deleted from the list of past users.

    For normal calculations of inactive periods, the use of cpu time by the
process between the two test points is used as the indicater of acitivity.
However, between the warning and final message to the user the buffered and
direct I/O's are also checked.  Thus hitting <Return> will be sufficient to
keep the process active after the warning message.  Justing hitting random
characters may not be, since these may be intercepted by the terminal server
and not have any effect on the processor.

User messages:
--------------

    The following message will appear when the user is due to be logged out:

ATTENTION - You will be Z A P P E D for inactivity in 1 minute.

    	   Hit <Return> to avoid being Z A P P E D.

    Two beeps will also sound at this time to catch his attention.  At this
point he can hit the Return or Enter keys, or any Gold or control ( Ctrl ? )
function keys.  If he does not hit one of these keys within one minute of
this message appearing, he will be logged off the system in an orderly manner
and the following message will be displayed:

ATTENTION - You have been Z A P P E D for inactivity.

    When the user returns to his terminal he may log back in as he usually does.

Test Modes:
-----------

    In order to fully ( hopefully ) verify the logic and operation of ZAPPER
at any time, the ZAPPER program has two variables which, when appropriately
set, will dump out all significant variables from the program.  Most will
be recorded in the log file, but some may also appear on the screen of the
person to be zapped.  The first technique is affected by giving 'test' the value
of "YES".  The second is affected by assigning to 'tester' the username of the
person wishing to test ZAPPER.  The tester can then verify that all and only
people deserving to be logged out are, and that the end-user warning messages
are working as intended.  The first technique also dumps the values read
from the data files, so that they can be verified as working properly.

    Naturally, when the program is not being tested these variables should be
set to null, in order to minimize the size of the log file and speed operation
slightly.

Submission:
-----------

    To submit the ZAPPER for running the system manager should
@SYS$SYSTEM:ZAPPER.  This will create a detached process with the appropriate
privileges and output mechanisms.  If ZAPPER is already running on the node it
will delete the older process first before creating the new one.  This will
allow any changes to allowable inactive times to take effect and release the
previous version of the log file to be released for inspection.

    ZAPPER only deletes processes from the processor that it is working on,
so it should be started on each node that the system manager wishes it to work
on.

    It may be undesirable to log off some users at any time.  Therefore the
time out value for those users or their images should be st set at 999999.
As a double check against this problem the program is currently setup to
also not boot off users with UIC's ending in 00.  This is a value that
is appropriate to my site, but you may wish to change this value at your
site, or comment out that logic altogether.  ( You may note that in the
program this variable actually refers to 64, but this is decimal, which is more
natural to BASIC, while 100, etc., is in octal, which is more natural to VMS ).

******

    And here's something you might like to use as an introduction you
can give to your users...


    			New Zapper Program
    			------------------

    In our continuiing efforts to improve system performance and security,
Technical Support will be introducing a new automatic function to the system.
This should begin during the morning of ( whatever date ).

    This function, which we call 'Zapper', will automatically log any and all
users off the system if they have been logged in without doing any work for a
certain period of time.  Thus unattended terminals cannot be used to effect the
system in any way, and the system's overhead is reduced so that it can do more
work to serve the users.

    The allowable time period that users can be logged in without doing any
terminal work varies for each application and potentially for each user.  Thus
different users are logged out at different times, as per the table at the end
of this note.  The following message will appear when the user is due to be 
logged out:

ATTENTION - You will be Z A P P E D for inactivity in 1 minute.

    	   Hit <Return> to avoid being Z A P P E D.

    Two beeps will also sound at this time to catch your attention.  At this
point you can hit the Return or Enter keys, or any Gold or control ( Ctrl ? )
function keys.  If you do not hit one of these keys within one minute of
this message appearing, you will be logged off the system in an orderly manner
and the following message will be displayed:

ATTENTION - You have been Z A P P E D for inactivity.

    When you return to your terminal you may log back in as you usually do.

