Question
· Mar 7, 2023

Questions about using ZSTOP

I am working on setting up our Failover techniques as we move to a Mirror Environment with a Arbiter, 2 Failover Nodes, and a Async (DR) Node. There are some system commands that I would like to call when the Mirror moves, and I am working on a ZMIRROR routine for that, but I also wanted to create an additional step if we wanted to manually shutdown and for the Mirror to move. So I was looking at using ZSTOP to call a couple of different items while shutting down, while the documentation has an example a couple of questions come to mind about using ZSTOP.

  • If we use ZSTOP do I need to account for all steps for shutting down an instance, or is ZSTOP a way to add additional steps to the shutdown process?
  • If I create a ZSTOP will it replace the current built in shutdown process?
  • Does anyone have any good examples or tips/tricks when it comes to using ZSTOP?

 

Thanks

Scott

Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:13:24 ED
Discussion (3)3
Log in or sign up to continue

Hi @Scott Roth ,

Ten years ago, I implement %ZSTOP routine to execute code when a job process exits or when the instance shutdown.  I removed my code, but the routine looks like this: 

%ZSTOP ; User shutdown routine. 
    Quit
SYSTEM ; Cache stopping
	
	Set oldNs = $Namespace
	
	Try {
		Set $Namespace = "MYAPPNAMESPACE"
		; Do something when stopping the instance.
	}Catch(ex) {}
	
	Set $Namespace = oldNS
    Quit
LOGIN ; a user logs out of Cache (user account or telnet)
    Quit
JOB ; JOB'd process exits. 
	If $Namespace = "MYAPPNAMESPACE" {
		; do something when job process exits
	}
    Quit
CALLIN ; process exits via CALLIN interface. 
    Quit
Logit(entrypoint, caller) PRIVATE ;
    Quit