PSDscResources icon indicating copy to clipboard operation
PSDscResources copied to clipboard

Service: Resource doesn't support setting recovery actions

Open saguiitay opened this issue 7 years ago • 4 comments

When creating a new Windows Service, you might want to specify the Recovery Action settings. The Service resource doesn't support those, which forces you to implement it manually using a Script resource, that executes:

sc failure <ServiceName> reset=120 actions=restart/60000/restart/120000/restart/180000
sc failureflag <ServiceName> 1

saguiitay avatar Aug 16 '17 07:08 saguiitay

This is similar to issue #69, which proposes recovery options and this issue proposes recovery actions.

johlju avatar Apr 30 '18 12:04 johlju

Does it seem like there's much value in putting a lot of work into avoiding the use of sc.exe and attempting to go directly to the registry to accomplish this? Or punt and use sc as the provider for this?

RandomNoun7 avatar Mar 23 '20 21:03 RandomNoun7

If sc only sets the registry and doesn’t do anything else behind the scene then setting registry entires sound like the easier road to go. Skip all the error ha sling by calling sc?

johlju avatar Mar 24 '20 19:03 johlju

Well, I guess we’ll find out if does anything else or not. ¯_(ツ)_/¯

RandomNoun7 avatar Mar 24 '20 19:03 RandomNoun7