Testing for server shutdown

When some runs QUIT, or the iSeries command

ENDDOMSVR SERVER(…) OPTION(*CNTRLD)

how do you test for server shutdown?

I want to add a program to ServerTasks. I want to bring it down gracefully when the server is told to end.

Subject: Testing for server shutdown

Call AddInShouldTerminate (should be called once every 5 seconds) to see if it is time to quit

Subject: Testing for server shutdown

WRKACTJOB will list all active jobs. Check if Domino is appearing in it.

This page will be useful for you:

http://www.itjungle.com/tfh/tfh081902-story04.html

Regards

Litty Joseph

Subject: RE: Testing for server shutdown

I understand how to bring the system down - I’m in the process of doing an i5/os 540 to 545 upgrade as I type (and it’s not my first one). Thanks anyway.I just want my new program to be able to sense that someone either typed in QUIT, or did the ENDDOMSVR *CNTRLD, and exit gracefully.

After reading this:

http://www-12.lotus.com/ldd/doc/uafiles.nsf/docs/i5osdom7/$File/apdev400.pdf

I suspect the “Server Status” field of the “Retrieve Domino Server Information (QnninRtvDominoServerI)” is what I want.

Subject: RE: Testing for server shutdown

It is not entirely clear on the nature of this program you are writing. You do mention adding it the ServerTask line, so I assume that you are writing a Notes addin program. If so, you should do as Jim R. suggested - “Call AddInShouldTerminate (should be called once every 5 seconds) to see if it is time to quit”. This is a portable interface (if you ever decide to run this program on another platform), and should be used by your program.

If you are trying to have an external program determine the status of a Domino server, see this discussion from a couple of months ago in this forum: http://www-10.lotus.com/ldd/nd6forum.nsf/PlatformAllThreadedweb/bc10e3d7949bb32a8525739b00055088?OpenDocument. The pasted reply:

You can use the interfaces outlined here: http://www-03.ibm.com/servers/eserver/iseries/domino/devtools/dominoapi/dominoapi.html

And there is a link for a full description of the APIs. However you should be able to cut and paste the code from the sample testsapi.cl CL program at this web page to retrieve the status of a Domino server in a CL program.

And to re-clarify - you do not want to use the i5/OS interface QnninRtvDominoServerI, if you are writing a Notes Addin to determine if your addin should terminate. The status returned by this API, is a latent status of the Domino server. i.e. If “server ending” is returned by this API, it means that all well-behaved Domino jobs have shutdown, but there still is one or more Domino jobs that have not ended (due to a hang, or not doing timely checks via AddInShouldTerminate to see if the job should terminate). You do not want you addin task to be one of those “bad-behaved” addins.