T.R | Title | User | Personal Name | Date | Lines |
---|
473.1 | $DCLEXH? | GIDDAY::GILLINGS | a crucible of informative mistakes | Tue Apr 15 1997 03:56 | 13 |
| Russell,
You can use SYS$DCLEXH to declare an exit handler, however the exact
behaviour depends on what you mean by "abort a process". If you mean
$DELPRC (or STOP/ID) then all bets are off. The process is summarily
deleted and user mode exit handlers are not run. If you use a softer
mechanism like SYS$EXIT (from within the process) or SYS$FORCEX (from
outside), your exit handler will run (but it probably won't need to since
the user mode FORTRAN and RMS handlers will clean up properly). If you
want to flush the buffers "manually" you can use SYS$FLUSH. Use FOR$RAB to
find the RAB address from FORTRAN unit number.
John Gillings, Sydney CSC
|
473.2 | $delprc isn't an $exit, it's a delete... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Tue Apr 15 1997 12:05 | 17 |
|
With STOP/ID ($DELPRC), what you are seeing is expected behaviour.
$DELPRC is a "big hammer", and is designed and intended to stop the
process *immediately*. This is deliberate, and means that $DELPRC
cannot be (easily) ignored, and cannot (typically) fail...
One can use an executive or kernel-mode rundown via UWSS (see the
user-written system service), but I do not recommend this approach.
Rather, I'd recommend using $FORCEX, or an application-specific
"exit request" mechanism. In either case, exit handler(s) can call
for a flush, and can close all open files.
Alternatively, recode the application to issue a flush at the
appropriate synchronization points, or recode the application
to use RMS journaling, or both.
|
473.3 | 2� | EVMS::MORONEY | Hit <CTRL><ALT><DEL> to continue -> | Tue Apr 15 1997 14:59 | 3 |
| With 20-20 hindsight, STOP/ID should have been coded to invoke $FORCEX, with
an additional $ STOP/ID/I_REALLY_REALLY_MEAN_IT to invoke $DELPRC for the
times it's needed.
|
473.4 | STOP/EXIT=PID would call $forcex | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Tue Apr 15 1997 15:07 | 6 |
|
:With 20-20 hindsight, STOP/ID should have been coded to invoke $FORCEX, with
:an additional $ STOP/ID/I_REALLY_REALLY_MEAN_IT to invoke $DELPRC for the
:times it's needed.
I've always thought that STOP/EXIT=PID would be a nice addition to DCL.
|
473.5 | | EPS::VANDENHEUVEL | Hein | Tue Apr 15 1997 16:21 | 25 |
| > I currently have an application that uses shared RMS indexed files. I
> have found that if I abort a process that has updated a file that all
> the changes are not flushed to the disk.
RMS out-of-the-box will NOT exhibit this behaviour.
RMS in a shared environment _will_ flush through changes.
RMS does have an option called DEFERRED WRITE which, you guessed
it, will defer writes and make application prones to errors.
Now FORTRAN on the other hand, may well default to set this
option it being a technical (=performance focus) language
and not a commercial (=security focus) language.
To switch this 'feature' off, you'll need a USEROPEN.
You may also want to consider a (timer-based) algoritme
to call SYS$FLUSH periodically, or investigate RMS RU-
Journalling for true transactional integrety.
Oh, and if you do decide to switch off deferred write, please
consider the potential performance ramifications before hand!
hth,
Hein.
|
473.6 | | AUSS::GARSON | DECcharity Program Office | Tue Apr 15 1997 22:19 | 11 |
| re .3
What you really want is something that terminates the process ($FORCEX
does not) but which allows proper cleanup. Currently this might mean
invoking $EXIT for multiple access modes (and in sequence). Another
solution might be to provide a hammer like a non-user mode rundown that
could allow RMS to flush buffers. This would still cause problems with
user mode (e.g. RTL) buffering. So while I agree with your DCL syntax,
there would be other changes needed. At the same time, one would
probably want to retain and have available at the DCL level the current
SYS$FORCEX capability.
|
473.7 | How about a Dataset Hangup? | KEIKI::WHITE | MIN(2�,FWIW) | Wed Apr 16 1997 15:33 | 7 |
|
Just curious but would a dataset hangup to a process which would
normally cause the process to exit do all the right things.
Can this be forced into the process?
Bill
|
473.8 | | EVMS::MORONEY | Hit <CTRL><ALT><DEL> to continue -> | Wed Apr 16 1997 15:51 | 19 |
| re .6:
> What you really want is something that terminates the process ($FORCEX
> does not) but which allows proper cleanup.
Depends on how the verb STOP should be interpreted. STOP (without /ID) to the
DCL prompt after a CTRL-Y just stops the current image. STOP/ID is an
uncompromising kill, not just a stop.
But yes, a "gentle" version of STOP/ID would be useful.
> At the same time, one would
> probably want to retain and have available at the DCL level the current
> SYS$FORCEX capability.
I had a DCL level FORCEX CLD and image for a DCL $ FORCEX command. It worked
like STOP process or STOP/ID except with an optional parameter, a status code
for FORCEX. I should dig it up.
|
473.9 | forcex.c | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Wed Apr 16 1997 16:07 | 78 |
| /*
** COPYRIGHT (c) 1992, 1996 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 OF 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 WHICH IS NOT SUPPLIED BY DIGITAL.
*/
/*
**++
** Facility:
**
** Examples
**
** Version: V1.0
**
** Abstract:
**
** Performs a $FORCEX on the specified target. Set up to
** be called as a foreign command.
**
** Author:
** Steve Hoffman
**
** Creation Date: 1-Jan-1990
**
** Modification History:
**--
*/
/*
/* Example/test program that performs a $FORCEX on the specified
/* process. Called as a foreign command, with one argument, the
/* hexidecimal PID of the target process. May require GROUP or
/* WORLD privilege.
*/
#include <ssdef.h>
#include <starlet.h>
#include <stdio.h>
main( int argc, char **argv )
{
unsigned long int retstat;
unsigned long int pid;
unsigned long int finalstat = SS$_BUGCHECK;
char hex[12];
if (( argc != 2 ) && ( argc != 3 ))
{
printf("this is a foreign command.\n");
printf("fx :== $ddcu:[dir]forcex\n");
printf("usage: fx pid\n");
printf(" fx pid exitstatus\n");
return SS$_BADPARAM;
}
sscanf( argv[1], "%x", &pid );
if ( argc == 3 )
sscanf( argv[1], "%x", &finalstat );
retstat = sys$forcex( &pid, 0, finalstat );
return retstat;
}
|
473.10 | | AUSS::GARSON | DECcharity Program Office | Wed Apr 16 1997 23:53 | 7 |
| re .8
>I had a DCL level FORCEX CLD and image for a DCL $ FORCEX command. It worked
>like STOP process or STOP/ID except with an optional parameter, a status code
>for FORCEX. I should dig it up.
I have that. I got it from John Gillings.
|
473.11 | Freeware CD | WKRP::16.72.96.42::KIER | My Grandchildren are the NRA! | Thu Apr 17 1997 21:58 | 4 |
| There is also the KILL program/verb on the Freeware CD which has an option
for /FORCE as well as some other nice features.
Mike
|