You can delay the shutdown of the Windows MediaAgent that hosts the Deduplication Database (DDB) by using StopProc.vbs script.
About This Task
When a MediaAgent that hosts the DDB is attempting to restart or shut down, by default the computer does not halt and the operating system shuts down regardless of any processes that are running.
However, SIDB.exe process receives the shutdown notification, it can bring down the DDB gracefully if there is enough time between the shutdown notification and the actual machine shutdown. If the graceful shutdown of the DDB takes more time than the operating system allows, the DDB might go into an unusable state and will require a DDB recovery. To prevent the shutdown while the SIDB.exe process is still running, use the following method to prevent the shutdown of the computer in most of the cases.
This method delays the restart of the DDB MediaAgent. However, in some scenarios, the operating system may override the configuration and restarts the DDB MediaAgent even if the StopProc.vbs script is installed.
Note: When the MediaAgent attempts to restart or shut down, the existing CVD.exe process stops so that it does not accept any more requests. By setting up the StopProc.vbs script, if there are any SIDB.exe processes that are running during this period, the CVD process goes into the Stopping state and waits for the SIDB.exe process to gracefully end before shutting down the MediaAgent.
Procedure
-
From the Run dialog box, type gpedit.msc, and then click OK.
-
From the Local Group Policy Editor, expand Local Computer Policy > Computer Configuration > Windows Settings > Scripts (Startup/Shutdown).
-
In the right pane, right-click Shutdown and click Properties.
The Shutdown Properties dialog box is displayed, and the StopProc.vbs script can be viewed.
If StopProc.vbs script is not populated, in the Command Prompt, from the software_installation_directory/Base folder, run the following command:
AddScripttoShutdownGPO.exe -vm InstanceXXX
-
Repeat step 3 to verify that the StopProc.vbs script is displayed in the Shutdown Properties.
-
On the Local Group Policy Editor, expand Local Computer Policy > Computer Configuration > Administrative Templates > System > Scripts.
-
Right-click the Maximum wait time for Group Policy script, and then click Edit.
-
In the Maximum wait time for Group Policy script Properties dialog box, select Enabled, and then in the Seconds box, enter 1800 (30 minutes).
By default, the time is set to 600 seconds (10 minutes).
This time interval prevents the shutdown while the SIDB.exe process is running. It allows the process to stop gracefully, preventing damage or corruption to the DDB.
Uninstalling the Shutdown Script
If you want to uninstall the script, in the Command Prompt, from the software_installation_directory\Base folder, run the following command:
AddScripttoShutdownGPO.exe -vm InstanceXXX -uninstall
After you run the command, you can restart the computer without any delays.