/build/static/layout/Breadcrumb_cap_w.png

Service Recovery Configuration

Hi All,

We have an app which is a little unreliable. The service which gets installed has failed / stopped from time to time.

I'd like to make use of the Recovery options so that if the service fails it restarts. This is obviously possible through the GUI, and you can also set it via the sc failure command line function.

I've not needed to set this before and I can't see that this can be done natively in the MSI though the ServiceControl table.. so is a CA to use sc failure my only option?

Thanks,
Rob.

0 Comments   [ + ] Show comments

Answers (21)

Posted by: Lindeberg IT 15 years ago
Senior Yellow Belt
0
Not the only option, you could set the FailureActions registrykey for the service...
Unfortunately, the MsiServiceConfigFailureActions Table is only available from Windows Installer 5.0 on.
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Thanks for the reply. The FailureActions value looks nasty.. think I'll steer clear of that and use the sc utility until Windows Installer 5 comes along [;)]

Cheers,
Rob.
Posted by: anonymous_9363 15 years ago
Red Belt
0
The simple expedient of refreshing RegEdit while changing the option for a randomly-selected service shows that selecting 'Recovery/First failure' to 'Restart the Service' writes a REG_BINARY to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[ServiceName]\FailureActions. I'd capture a selection of those (for different scenarios) and add one to the Registry table. I also noticed that not all services offer a recovery option.
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Thanks Ian, I appreciate the theory but I think I'd rather use the sc utilility as a CA if I can't handle the service settings properly through the regular MSI tables.
Posted by: jmcfadyen 15 years ago
5th Degree Black Belt
0
u could use native msi functionality of msi 5.0 as well. buts it is likely a big ask to upgrade (if possible).
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Yup we probably won't see 5.0 here until Windows 7 comes along... Which is a great OS if you ask me [:)]
Posted by: AnneWang 15 years ago
Senior Yellow Belt
0
Would it be possible for you to show me how to write a CA to handle this using the sc utility? I never use the sc utility either. I am using InstallShield 2008 to develop msi package for Windows 2008 x64 system and need to firgure out how to set service recovery options for the first time. I need to set Service Recovery settings for "First Failure & Second Failure" to restart the service and no aciton for subsequent failures. Also, need to reset fail count after 3 days, restart the service after 0 min and set "Enable Actions For Stops with errors" to enabled. Any help is much appreciated. - Anne
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
If you do come up with an sc CA, let us know. I was unable to make that work, but Ian's method did work for me.
Posted by: AnneWang 15 years ago
Senior Yellow Belt
0
What exactly did you put in the registry under teh FailureActions subkey? How do you figure out what to put in there?
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
i had to configure the service manually and export the reg key. it was a binary value.
Posted by: AnneWang 15 years ago
Senior Yellow Belt
0
Thanks! I guess that will work but sure makes me feel uneasy. I hate to set registry values this way but I can see it works. Do you know any documenation on this? I been looking but not able to fine any.
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
It does seem to be pretty poorly documented...but doing a search (google or yahoo SYSTEM\CurrentControlSet\Services +FailureActions gets some hits) I forget if I read it here or just figured it out on my own, but the app I did it for went out to about 500 servers and no complaints yet...[:D]
But at least it is addressed by the newest windows installer/windows...from what others said ;-)
Posted by: anonymous_9363 15 years ago
Red Belt
0
Owen, might there be a WMI class you could use?
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
The thought occured to me, but I could not find one. Win32_Service doesn't provide it, from what I can tell.
Posted by: AnneWang 15 years ago
Senior Yellow Belt
0
Using your method of importing the registry data doesn't contains the "Enable Actions For Stops With Errors" setting. I need to set this to 'enabled'. Does anyone know where this is in the registry? Thanks for the help!!!
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
look at the wmi class win32_service, it may have it, if not remind me on Tuesday (long weekend!)
Posted by: AnneWang 15 years ago
Senior Yellow Belt
0
Hoped you had a nice long weekend. I didn't find anyting in win32_service for this nor any Service Recovery setting either. Did you ever have to do this for your service? Thank you for responding and help!
Posted by: coluhandria 14 years ago
Yellow Belt
0
Hello!

According to this topic with the new Windows Installer 5.0 table MsiServiceConfigFailure I have a question, tried to find out but couldn't get there.

I tried to configure the behavior of a service that is installed with the package using the table MsiServiceConfigFailure but I always get an error message and the log says:

[font="courier new"]MSI (s) (AC:58) [09:33:04:647]: Executing op: ActionStart(Name=InstallServices,Description=Installing new services...,Template=Service: [2])
MSI (s) (AC:58) [09:33:04:647]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (AC:58) [09:33:04:647]: Executing op: ServiceInstall(Name=NMSAccessU.exe,DisplayName=NMSACces,ImagePath="C:\Program Files\CDBurnerXP\NMSAccessU.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies=[~],,,Password=**********,Description=cDxpf,,)
MSI (s) (AC:58) [09:33:04:850]: Executing op: ActionStart(Name=MsiConfigureServices,,)
MSI (s) (AC:58) [09:33:04:850]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (AC:58) [09:33:04:850]: Executing op: ServiceConfigure(,Name=NMSAccessU.exe,Event=1,ConfigType=3,Argument=1)
MSI (s) (AC:58) [09:33:04:850]: Changing configuration of service NMSAccessU.exe.
MSI (s) (AC:58) [09:33:04:850]: Changed configuration of service NMSAccessU.exe with ConfigType SERVICE_CONFIG_DELAYED_AUTO_START_INFO
MSI (s) (AC:58) [09:33:04:850]: Done changing configuration of service NMSAccessU.exe
MSI (s) (AC:58) [09:33:04:850]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (AC:58) [09:33:04:850]: Executing op: ServiceConfigureFailureAction(,Name=NMSAccessU.exe,Event=1,ResetPeriod=87644,RebootMessage=Der Computer muss neu gestartet werden,Command="",Actions=0[~]1[~]2,DelayActions=0[~]60000[~]60000)
MSI (s) (AC:58) [09:33:04:850]: Changing configuration of failure action for service NMSAccessU.exe.
MSI (s) (AC:58) [09:33:04:850]: Error: 5. Failed to change current configuration of failure action for service NMSAccessU.exe
MSI (s) (AC:58) [09:33:04:850]: Failed to change configuration of failure action for service NMSAccessU.exe
MSI (c) (04:30) [09:33:04:865]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 1939. Service 'NMSACces' (NMSAccessU.exe) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
MSI (s) (AC:58) [09:33:08:100]: Product: CDBurnerXP -- Error 1939. Service 'NMSACces' (NMSAccessU.exe) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.

The installations user is in the Administrator group...
Posted by: anonymous_9363 14 years ago
Red Belt
0
Have you checked that the service allows a recovery option, using the 'Services' applet? Not all services do.
Posted by: coluhandria 14 years ago
Yellow Belt
0
Hmm, it doesn't seem to be that, because for testing purposes I tried to configure the Service "Design" (Themes) which already has set failure actions, so I set them all to "Take No Action" for letting my msi configure the actions, but still the same error..
Posted by: coluhandria 14 years ago
Yellow Belt
0
Hello everybody!

I just wanted to refresh the topic... Because I made some tests in between and found out that only the ConfigFailureAction "3" is working, but not really properly, means, that then all the 3 Failure Actions are set to "Start a programm"
But with this option the msi runs nomally through. Has someone something to share to this topic or can confirm the same experience? It would be very helpful!

Thanks!!!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ