Module GatewayHook shutdown not called on Gateway stop


I am working on a developing a module. In the shutdown method of GatewayHook of the module, I am calling a task to log ShutDown status in the audit database.

What I observed is , this method gets called and record gets added to the database when :

  1. Module is restarted from Gateway Home Page -> Configure -> Modules
  2. Restart the Gateway from gcu (Gateway Control Utility)

However from gcu when I just stop the gateway or stop the gateway service from Task Manager, this shutdown method is not called.

I basically want to track the Gateway shutdown and start through Module GatewayHook shutdown and startup methods.

I am using Ignition version 7.7.5 RC3.

Following is the code for shutdown :

public void shutdown() {
log.error(“gateway shutdown task called”);

		//call function to log gateway stop time
		this.gatewayContext.getExecutionManager().executeOnce(new LogGatewayStatus(this.gatewayContext, "GATEWAY_SHUTDOWN"));
	catch(Exception e)
		log.error("shutdown hook exception : " + e.getMessage());


LogGateway Status -> run method has code to add a record to Audit.

Is there any other way to track gateway shutdown or start ?

Appreciate any help regarding this.


I think we fixed a bug that caused the gateway to shutdown immediately, rather than cleanly and orderly, for 7.7.6.