Shutting down custom system services gracefully
If you are running a custom system service as an EGO service, you can specify a script to clean up and shut down service instances. If you do not have a shutdown script, you can simply enable service instances to be shut down. In both cases, you can configure a timeout during which the system waits for the target instance to exit. The system ends the target instance if it is still running after the timeout expires.
About this task
Procedure
What to do next
If you need to troubleshoot, use the following tips:
Check the EGOSC log under $EGO_ESRVDIR/esc/log. You should see:
2009-04-01 09:17:17.000 CST WARN [13769] do_containerStateChange(): on host <bjg270-01>, the container <9> belongs to instance <1> of service <test> terminated, reason <Terminated by SIGKILL, job controller does not exist or failed>, status <0>
- If only ControlWaitPeriod was added to the service profile, you would see
the following messages in the EGOSC log:
2009-04-01 11:49:31.000 CST ERROR [8946] validContainerSpec(): Conflict parameters, controlWaitPeriod is defined but JobController is not defined, refused2009-04-01 11:49:31.000 CST ERROR [8946] loadServiceDefinition(): parse section ServiceDefinition failed
2009-04-01 11:49:31.000 CST ERROR [8946] loadServiceDefinition():parse service definition file /opt/ego/eservice/esc/conf/services/test.xml failed
2009-04-01 11:49:31.000 CST ERROR [8946] loadServices(): failed to load service definition from </opt/ego/eservice/esc/conf/services/test.xml>
Add the JobController parameter to the service profile.
- If ControlWaitPeriod in the service profile is less than 0 or greater
than 1 hour, you would see the following messages in the EGOSC log.
2009-04-01 12:25:30.000 CST ERROR [10321] validContainerSpec(): Invalid controlWaitPeriod, refused
2009-04-01 12:25:30.000 CST ERROR [10321] loadServiceDefinition(): parse section ServiceDefinition failed
2009-04-01 12:25:30.000 CST ERROR [10321] loadServiceDefinition():parse service definition file /opt/ego/eservice/esc/conf/services/test.xml failed
2009-04-01 12:25:30.000 CST ERROR [10321] loadServices(): failed to load service definition from </opt/ego/eservice/esc/conf/services/test.xml>
Set a value for ControlWaitPeriod in the 0~1hour range.
- If ControlWaitPeriod is defined as PT0H0M0S, PT0M0S, or PT0S, EGO will set the value of ControlWaitPeriod to 2 minutes, and at the same time remove ControlWaitPeriod from the service profile. Define ControlWaitPeriod again and set the value to be greater than 2 minutes.
- If only JobController is defined, the default value for ControlWaitPeriod is 2 minutes. Change the value for ControlWaitPeriod.