Hi,
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 :
- Module is restarted from Gateway Home Page -> Configure -> Modules
- 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 :
@Override
public void shutdown() {
try
{
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)
{
e.printStackTrace();
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.
Regards,
Yogini