Service cleanup command
You can run the cleanup command that is defined by the component manager to help the component manager to uninstall the service.
- When service instances are no longer running on the host.
- The inactivity period is reached on the host.
- The host is excluded by the service's resource requirements.
When the EGO Service Controller completes the service check in its housekeeping, it checks the hosts in the timer list one by one. If the timer ends, it triggers the cleanup command execution on that host.
For the cleanup command execution, the EGO Service Controller uses the Admin EGO activity. The EGO Service Controller builds a new container specification, which belongs to the supper allocation and carries the cleanup command, then sends it to VEMKD for execution. The activity then runs as the service’s operating system execution user.
After the cleanup command finishes executing on the host, the EGO Service Controller will reset the notification flag for the host among the service. If the host meets the service’s ResReq again, the new service instances that run on the host receives the FirstStart reason notification. If a host is brought back before the cleanup command execution finishes, the new service instance waits until the cleanup command finishes.
The EGO Service Controller monitors the time of the cleanup command execution. The default maximum wait period for the cleanup execution is 120 seconds.
To support the EGO Service Controller data persistence, the parameter ESC_WORKDIR must be configured in the egosc_conf.xml file.
serviceA_vip:
type: IBM::ASC::Activity
properties:
cleanup:
command: /temp/monitor.sh
timeout_sec: 30
inactivityperiod_sec: 1800
- command (CleanupCommand in the service profile), which
specifies the service controller cleanup command. If the CleanupCommand parameter is configured, the
InactivityPeriod parameter must also be configuredNote: If you configure the cleanup command for a service, then the MaxInstancePerHost parameter for the service has to be 1.
- inactivityperiod_sec (InactivityPeriod in the service profile), which specifies the duration of inactive service instances that can occur on the host before the service controller starts the cleanup command. The value should be the same as other duration elements, such as PTnHnMnS. The range is greater than 0 seconds and less than 3600 seconds. The InactivityPeriod parameter must be configured if the CleanupCommand parameter is configured.
- timeout_sec (CleanupFinishWaitPeriod in the service profile), which specifies the duration that the service controller waits for the cleanup command to complete before it ends the cleanup activity. The value should be the same as other duration elements, such as PTnHnMnS. The range is greater than 0 seconds and less than 3600 seconds. The default value is 120 seconds.
<sc:ActivityDescription>
<ego:ActivitySpecification>
<ego:CleanupCommand>/opt/biginsights/spark/uninstall.sh
</ego:JobMonitorUpdateInterval>
<ego:InactivityPeriod>PT60s</ego:InactivityPeriod>
<esc:CleanupFinishWaitPeriod>PT120s</esc:CleanupFinishWaitPeriod>
</sc:ActivityDescription>
</ego:ActivitySpecification>