Operating System - OpenVMS
1753797 Members
7690 Online
108804 Solutions
New Discussion юеВ

Detecting restart in SYSTARTUP_VMS

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Detecting restart in SYSTARTUP_VMS

I want to add DCL to SYSTARTUP_VMS.COM
that only runs after a crash-restart.
What can I check for that would indicate
a restart as opposed to a normal boot? TIA
26 REPLIES 26
David B Sneddon
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

Jack,

One solution (there are probably many) that springs
to mind:

In SYSHUTDWN, create a marker file somewhere to indicate
a normal shutdown. In a crash, this will not be created.
In SYSTARTUP_VMS, if the file exists then it was a
"normal" shutdown, if not then there was a crash.
DELETE the file in SYSTARTUP_VMS.

Regards
Dave
Mobeen_1
Esteemed Contributor
Solution

Re: Detecting restart in SYSTARTUP_VMS

Jack,
I thought of something like Dave suggested, you can also look at DECevent or something.

But, i was researching if there is any lexical function that can tell this. I was looking into the lexical arguments for such and still doing so. If we could get some lexical, then it will probbaly be the best solution

rgds
Mobeen
David B Sneddon
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

I probably should have added --

the best solution will likely be determined by
exactly what it is you are trying to achieve.

Dave.
Volker Halle
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

Jack,

if the system has a valid SYSDUMP.DMP file, you can check during startup, whether a new dumpfile has been written, i.e. whether the system is now just booting after a valid system crash:

- OpenVMS Alpha (V6.2 or higher):

$ directory/modify/since="''f$getsyi("boottime")'" -
clue$collect:clue$'F$GETSYI("NODENAME")'_%%%%%%_%%%%.lis
$ IF $STATUS
$ THEN
$! system is booting after a valid crash
$ ENDIF

- OpenVMS VAX (V6.0 or higher)

$ SEARCH CLUE$OUTPUT:CLUE$LAST_'F$GETSYI("NODENAME")'.LIS "Operator Shutdown on Node"
$ IF $STATUS .EQ. %X08D78053 ! %SEARCH-I-NOMATCHES
$ THEN
$! system is booting after a valid crash
$ ENDIF

This logic depends on the fact that a new 'CLUE file' is being created by the OpenVMS system startup procedures. It has been successfully used to automatically log/mail system crash information.

Volker.
Jan van den Ende
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

Jack,

actually, _WE_ want to be triggered earlier.

On our cluster, every node is pretty frequently checking the still-presence of all other know nodes.

If one is missing, immediately a pager call is sent to the stand-by system manager.

Of course, you do not want that on a scheduled shutdown.

Our implementation of this:
create a clusterwide logical name with a list of the active cluster nodes.
In SYSHUTDWN remove the shutting node from that list.
Also, to prevent a continuous stream of pager calls, remove that name after sending a pager call.

Potential caveat: who will signal if the whole site goes down?
For us no heavy worry, because our cluster is multi-site.
A bigger worry is the fact that the pager mechanism depends on the phone being available & functioning!

fwiw,

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Mobeen_1
Esteemed Contributor

Re: Detecting restart in SYSTARTUP_VMS

Jan,
This works on a Cluster, but what happens if the VMS system that Jack is trying to implement is a stand-alone server and not part of a VMS cluster.

regards
Mobeen
Jan van den Ende
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

Mobeen,

that's correct, this is a cluster-only solution.

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Mobeen_1
Esteemed Contributor

Re: Detecting restart in SYSTARTUP_VMS

All,
Does any one know of a lexical function that can tell me if the server was shutdown normally or if it crashed ?

I have searched for a long time without any luck :), if there is such a thing, then that should help Jack

rgds
Mobeen
Volker Halle
Honored Contributor

Re: Detecting restart in SYSTARTUP_VMS

Mobeen,

there is no lexical function or anything similar and simple designed into OpenVMS to find out, if the system is booting after a crash or a shutdown.

Note that there also is no possibility to find out, if someone has just done an external halt and boot (or hit the RESTART button).

You could also try SEARCH OPERATOR.LOG;-1 for the string "'nodename' shutdown was requested by the operator"

Or you could try to look at the most recent errors in ERRLOG.SYS and look for a bugcheck errlog entry.

Looking for the CLUE file was the best method we could come up with, when we created the AutoCLUE (later called CCAT) startup command procedures for automatic crash call logging.

Volker.