The Question is:
One of our clients have a process running on our Alpha machine, they want to
terminate idle processes after a certain amount of time.
I believe they're using a hardware solution to accomplish that at the moment.
The problem is that when the idle processes are killed, it sometimes leaves
their current records locked. We would want to write a program or command
procedure so that it clea
rs any record/file locks after killing the process. Is it possible to do that,
given the process's username? Or, alternatively, is there some sort of
"cleanup" program available in that clears "orphan" locked records?
The Answer is :
If using the OpenVMS distributed lock manager, OpenVMS cleans up
the locks of deleted processes; the current RMS records and files
are automatically unlocked, and any other uses of the distributed
lock manager are also resolved -- the lock manager provides rather
more than file and record locks, and is often used for tasks such
as intracluster interprocess communications and intracluster
It is obviously possible for an application to use other
application-specific locking techniques, and any such clean-up
involved is accordingly and entirely application-specific.
With a software-based process deletion, initial use of $forcex is
generally recommended over $delprc -- $delprc may eventually be
needed, but it is generally not the best initial choice. (Various
idle-process deletion tools are discussed in the OpenVMS FAQ.)
$forcex causes the process exit handlers to be invoked, while
$delprc does not; $delprc is a process hard-kill operation.
As is common practice, process deletions and power failures
can have similarities and can potentially leave applications
and application data in inconsistent states -- transaction
and database systems are common solutions when there are
multi-part update operations and/or the necessity of an
ability to back-out transactions, and database packages and
RMS journaling are options.
For general programming discussions, please see topic (1661)
and topics referenced there.
DECamds and Availability Manager can be used to view OpenVMS
locks, but, again, the OpenVMS Wizard would not assume these
are in use here as locks owned by processes are released when
the processes are deleted and when a cluster member node
exists the cluster.
Do ensure you have the current ECOs for OpenVMS, of course.