[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference share::zap

Title:Zap Technical Conference
Notice:ZAP Version 5.3 is available. See note 1.1
Moderator:ZAPDEV::MACONI
Created:Mon Feb 24 1986
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:170
Total number of notes:492

153.0. "Exemption By Rights Identifiers, Callable Routine" by TROU07::HANDY (Lyndon Handy-ITU Operations) Fri Oct 14 1994 17:31

Zap Gurus:

I need some help with a creating a callable DCL command procedure that 
ZAP may execute to selectively target processes for deletion.  We have a system
that has a few hunder generic user accounts.  Currently we run ZAP to target
all interactive user processes for deletion after the specified idle period
has expired.  BUT, some of the users are part of a special group that are
exempt.  These users cannot be identified from other users because they are 
in the same UIC group, and run the same images.  Maintaining the list of
username in the ZAP configuration file is much too cumbersome.

What I would like to do is target the idle processes as usual, however, the
'special' users would be excluded from deletion by use of an OpenVMS
RIGHTS IDENTIFIER.

I believe that this can be done from a user-supplied DCL command procedure.

Is there an example procedure available?  Has anyone done this before?  Am I 
on the right track?

Thanks!

Lyndon Handy
Operations Management Services
Digital Equipment Of Canada 
T.RTitleUserPersonal
Name
DateLines
153.1Possible solutionZAPDEV::MACONIThe Doctor is InTue Oct 18 1994 11:0757
$ !*	ZAP$DIR:ZAP$PROCESS_ID.COM
$
$ !***************************************************************************
$ !
$ !                          COPYRIGHT (C) 1994 BY
$ !                    DIGITAL EQUIPMENT CORPORATION, MAYNARD
$ !                     MASSACHUSETTS.  ALL RIGHTS RESERVED.
$ !
$ !  THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
$ !  ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
$ !  OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES
$ !  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER
$ !  PERSON.  NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
$ !
$ !  THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
$ !  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
$ !
$ !  DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
$ !  SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
$ !
$ !***************************************************************************
$
$ !	Set up error checking
$
$	Set noon
$	On error then exit
$
$ !	Enable privileges
$
$	Set process/priv=(noall,tmpmbx,netmbx,world)
$
$ !	Get a list of the processes identifiers
$
$	Process_Ids = "," + f$getjpi(p1,"process_rights") + ","
$
$ !	Check to see if the process contains the following rights.
$ !	Always include the right between commas to ensure exact matches
$
$	If f$locate(",LOCAL,",Process_Ids) .lt. f$length(Process_Ids) Then -
		Goto Process_Has_Local_Id
$
$	Goto No_Match_Found
$
$ Process_Has_Local_Id:
$
$ !	Stop the process
$ !	P1 contains the PID of the target process
$
$	Stop/Id='p1'
$
$	Exit 1
$
$ No_Match_Found:
$
$ !	Ignore the process
$
$	Exit 1
153.2Thanks- Have a question...TROU07::HANDYLyndon Handy-ITU OperationsTue Oct 18 1994 16:508
Thanks!  

Is it safe to say that the USERxxx callable routine will only be executed
for a particular process-id when the idle time period expires.  I just want
to double-check on this before I implement, as I don't want to see processes
killed that have not reached their respective idle timeout period.

Lyndon
153.3YesZAPDEV::MACONIThe Doctor is InThu Oct 20 1994 09:3214
The action specified is only taken when the process reaches the idle time limit
as specified in that exception rule.

Caution:  USERxxx routines generate a sub-process to execute the command
	procedure each time a process reaches it's idle time limit.  You may
	need to increase the process limit for ZAP otherwise not all "idle"
	processes will be able to have the action taken.  It all depends on
	how many processes reach their limit at the same time.

You should check your ZAP log file to determine if there were any times that it
could not start the sub-process.  If you find any, modify the ZAP startup
procedure and restart ZAP to correct the problem.

					Keith
153.4ThanksTROU07::HANDYLyndon Handy-ITU OperationsFri Oct 21 1994 14:049
>You should check your ZAP log file to determine if there were any times that it
>could not start the sub-process.  If you find any, modify the ZAP startup
>procedure and restart ZAP to correct the problem.

Thanks, will do.

Lyndon

153.5Problem With ZAP Messages After ImplementingTROU07::HANDYLyndon Handy-ITU OperationsThu Nov 17 1994 13:1515
Ok, the procedure and modifications seem to work fine, however, we have 
run into an unanticipated problem.

The 'special' group of users that have the NOZAP identifier still get 
messages after the timeout period has expired, even if their process is 
NOT to be deleted by ZAP.  For example, I granted my account the NOZAP 
identifer, and logged in.  I received regular messages from ZAP that the 
timeout period was about to expire, then it gave me a 'logout' message, 
however my process was unaffected.

Can I suppress these messages for the 'special' users?  We still require
these messages to be send to the terminals of those users whos processes 
WILL be stopped by ZAP.

Lyndon
153.6Rules processing prohibits itZAPDEV::MACONIThe Doctor is InThu Nov 17 1994 14:0114
In a word, no.

The reason is that messages are sent out as a process approaches it's idle time
limit because of the exception rule used for the process.  If the exception
rule indicates that messages are to be sent out, then they are.

Since you are actually performing an additional check _after_ Zap has
activated the user written procedure, there is no way to tell Zap that no
messages were required.

What you face is your original problem again.  How do you distinguish different
processes to Zap without adding rules for each user?

					Keith