File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/ServiceControlInstaller.Engine/Services Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,7 @@ public static void SetRecoveryOptions(string serviceName)
8080
8181 void SetRestartOnFailure ( string serviceName )
8282 {
83- const int actionCount = 2 ;
84- const uint delay = 60000 ;
83+ const int actionCount = 3 ;
8584
8685 var service = IntPtr . Zero ;
8786 var failureActionsPtr = IntPtr . Zero ;
@@ -95,18 +94,27 @@ void SetRestartOnFailure(string serviceName)
9594 var action1 = new SC_ACTION
9695 {
9796 Type = SC_ACTION_TYPE . SC_ACTION_RESTART ,
98- Delay = delay
97+ Delay = 10000
9998 } ;
10099
101100 Marshal . StructureToPtr ( action1 , actionPtr , false ) ;
102101
103102 var action2 = new SC_ACTION
104103 {
105- Type = SC_ACTION_TYPE . SC_ACTION_NONE ,
106- Delay = delay
104+ Type = SC_ACTION_TYPE . SC_ACTION_RESTART ,
105+ Delay = 30000
107106 } ;
107+
108108 Marshal . StructureToPtr ( action2 , ( IntPtr ) ( ( long ) actionPtr + Marshal . SizeOf ( typeof ( SC_ACTION ) ) ) , false ) ;
109109
110+ var action3 = new SC_ACTION
111+ {
112+ Type = SC_ACTION_TYPE . SC_ACTION_RESTART ,
113+ Delay = 60000
114+ } ;
115+
116+ Marshal . StructureToPtr ( action3 , ( IntPtr ) ( ( long ) actionPtr + ( Marshal . SizeOf ( typeof ( SC_ACTION ) ) * 2 ) ) , false ) ;
117+
110118 var failureActions = new SERVICE_FAILURE_ACTIONS
111119 {
112120 dwResetPeriod = 0 ,
You can’t perform that action at this time.
0 commit comments