Startup scripts
- Last UpdatedAug 06, 2024
- 3 minute read
Startup scripts are called when an object containing the script is loaded into memory, such as during deployment, platform, or engine start.
Startup instantiates COM objects and .NET objects. Depending on load and other factors, assignments to object attributes from the Startup method may fail. Attributes that reside off-object are not available to the Startup method.
Startup scripts for redundant AppEngines
There are certain considerations that you must take into account when writing a Startup script that will run on redundant AppEngines. This section outlines whether or not a script will be executed under various scenarios, including deploy, forced failover, system failure, system startup, and undeploy operations.
Redundant engines can be set to run in either Legacy Mode or Run Warm Mode. Startup scripts for redundant engines may operate differently, depending on the selected redundancy mode.
Note: New redundant engines default to Run Warm Mode. Redundant engines in migrated galaxies default to Legacy Mode.
-
Legacy mode (RunWarm attribute is disabled): In Legacy mode, the Standby engine does not start until failover occurs. This will result in longer failover times when compared with Run Warm Mode. Highlighted text indicates where there is a difference in script execution between Legacy mode and Warm Redundancy mode.
|
Legacy mode |
Primary engine (server 1) |
Backup engine (server 2) |
Startup script |
||
|---|---|---|---|---|---|
|
Action |
Initial state |
End state |
Initial state |
End state |
Script execution |
|
Deploy |
Down |
Active OnScan |
Down |
Standby |
Startup scripts execute when the primary engine starts. Startup scripts do not execute on the backup engine as it starts and transitions to standby. |
|
Forced Failover |
Active OnScan |
Standby |
Standby |
Active OnScan |
Startup scripts execute when the backup engine starts. |
|
Server 1 Failure (hard shutdown) |
Active OnScan |
Down |
Standby |
Active OnScan |
Startup scripts execute when the backup engine transitions from standby to active. |
|
Server 2 Failure (hard shutdown) |
Active OnScan |
Active OnScan |
Standby |
Down |
Startup scripts do not execute in the event of a server 2 failure. |
|
Graceful shutdown of Server 1 platform or engine using OCMC |
Active OnScan |
Down |
Standby |
Active Offscan |
Startup scripts execute when the backup engine starts. The primary engine shuts down, Standby engine is started and goes to active but remains offscan. |
|
Graceful shutdown of Server 2 platform or engine using OCMC |
Active OnScan |
Active OnScan |
Standby |
Down |
Startup scripts do not execute. Shutdown of Server 2 has no affect on operations. Server 1 continues running onscan. |
|
Start Server 1 only |
Down |
Active OnScan |
Down |
Down |
Startup scripts execute when the Primary Engine on Server 1 starts. |
|
Start Server 2 (Server 1 running) |
Active OnScan |
Active OnScan |
Down |
Standby |
Startup scripts do not execute when the Backup Engine starts. Server 1 continues running onscan. |
|
Undeploy |
Active OnScan |
Down |
Standby |
Down |
Startup scripts do not execute during an undeploy operation. |
-
Run Warm mode (RunWarm attribute is enabled): In Run Warm mode, Startup scripts do not execute during a failover in most circumstances, since both the Primary and Backup engines start concurrently. The Backup Engine on Server 2 will only execute Startup scripts if the Primary Engine on Server 1 is down. Highlighted text indicates where there is a difference in script execution between Legacy mode and Warm Redundancy mode.
|
Warm redundancy mode |
Primary engine (server 1) |
Backup engine (server 2) |
Startup script |
||
|---|---|---|---|---|---|
|
Action |
Initial state |
End state |
Initial state |
End state |
Script execution |
|
Deploy |
Down |
Active OnScan |
Down |
Standby |
Startup scripts execute on both engines when the engines start (both engines start with warm redundancy). |
|
Forced Failover |
Active OnScan |
Standby |
Standby |
Active OnScan |
As the active engine transitions from active to standby, the active engine shuts down and restarts as the standby engine. This triggers the startup script to run again. |
|
Server 1 Failure (hard shutdown) |
Active OnScan |
Down |
Standby |
Active OnScan |
Startup scripts do not execute again because the backup engine has already started. |
|
Server 2 Failure (hard shutdown) |
Active OnScan |
Active OnScan |
Standby |
Down |
Startup scripts do not execute in the event of a server 2 failure. Server 1 continues to run. |
|
Graceful shutdown of Server 1 platform or engine using OCMC |
Active OnScan |
Down |
Standby |
Active OFFscan |
Startup scripts do not execute again. The active engine shuts down, standby engine previously started and now goes to active but remains offscan. |
|
Graceful shutdown of Server 2 platform or engine using OCMC |
Active OnScan |
Active OnScan |
Standby |
Down |
Startup scripts do not execute. Shutdown of server 2 has no affect on operations. server 1 continues running onscan. |
|
Start Server 1 only |
Down |
Active OnScan |
Down |
Down |
Startup script executes when Primary Engine starts. |
|
Start Server 2 (Server 1 running) |
Active OnScan |
Active OnScan |
Down |
Standby |
Startup scripts execute when the backup engine starts on server 2 (runs as standby). Server 1 continues running onscan. |
|
Undeploy |
Active OnScan |
Down |
Standby |
Down |
Startup scripts do not execute during an undeploy operation. |