3.4.3 MxDB for SQL Server Installation and Administration Guide
Chapter 3: Configuration and Operation 53
Copyright © 1999-2007 PolyServe, Inc. All rights reserved.
server. On all other servers configured for the monitor, the Pre Stop script
is run to ensure that the service is not active.
Post Start scripts must be robust enough to run when the service is
already started, without considering this to be an error. Similarly, Pre
Stop scripts must be robust enough to run when the service is already
stopped, without considering this to be an error. In both of these cases,
the script should exit with a zero exit status.
This behavior is necessary because the Post Start and Pre Stop scripts are
run to establish the desired start/stop activity, even though the service
may actually have been started by something other than MxDB for SQL
Server. The Post Start and Pre Stop scripts must also handle recovery
from events that may cause them to run unsuccessfully.
For example, if the system encounters a problem, the script will fail and
exit non-zero. The service could then become active on another node,
causing the Pre Stop script to run on the original node even though the
Post Start script did not complete successfully.
Use Custom Scripts to Modify Start/Stop Activities
The SQL monitor performs certain starting or stopping activities. If you
need to take an action before or after the starting or stopping activity, you
can create a custom Start or Stop script for the action and specify it on the
Scripts tab for the monitor.
The default order for starting is:
• Run the monitor’s starting activities (if any)
• Run the custom Start script (if any)
If you want to reverse this order, preface the Start script with the prefix
[pre] on the Scripts tab.
The default order for stopping is:
• Run the custom Stop script (if any)
• Run the monitor’s stopping activities (if any)
If you want to reverse this order, preface the Stop script with the prefix
[post] on the Scripts tab.