Service checks
Service checks enables you to specify which applications you want to run before any service starts up, shuts down, or is aborted. Likewise, applications can be run before a particular service is started, stopped, or aborted. When running a service check before any service is started, you are validating all of the policies that are defined in the history_subscriptions.xml file for history logging.
About this task
When an application is run, it must return a 0 on success and a nonzero value on failure. If the application should fail before a service starts, the service will not start.
- before_start
- Runs before the service starts.
- after_stop
- Runs after the service stops.
- after_abort
- Runs after the service stops.
Procedure
Example
In this example, a service check runs before any service is started:
[service.check all]
before_start=my test –option=some arg
In this example, a service check runs before a service named appsvr2 starts:
[service.check appsvr2]
before_start=my test –option=some arg
In this example, two service checks run for a service named scheduler:
[service check scheduler]
after_abort: my_cleanup_script.sh
before_start: check_something.exe