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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 05/19/2009 by: Lindeberg IT
Senior Yellow Belt

Please log in to comment
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.
Answered 05/19/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
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.
Answered 05/19/2009 by: VBScab
Red Belt

Please log in to comment
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.
Answered 05/19/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
u could use native msi functionality of msi 5.0 as well. buts it is likely a big ask to upgrade (if possible).
Answered 05/19/2009 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
Yup we probably won't see 5.0 here until Windows 7 comes along... Which is a great OS if you ask me [:)]
Answered 05/20/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
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
Answered 08/14/2009 by: AnneWang
Senior Yellow Belt

Please log in to comment
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.
Answered 08/14/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
What exactly did you put in the registry under teh FailureActions subkey? How do you figure out what to put in there?
Answered 08/14/2009 by: AnneWang
Senior Yellow Belt

Please log in to comment
0
i had to configure the service manually and export the reg key. it was a binary value.
Answered 08/14/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
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.
Answered 08/14/2009 by: AnneWang
Senior Yellow Belt

Please log in to comment
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 ;-)
Answered 08/14/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Owen, might there be a WMI class you could use?
Answered 08/16/2009 by: VBScab
Red Belt

Please log in to comment
0
The thought occured to me, but I could not find one. Win32_Service doesn't provide it, from what I can tell.
Answered 08/17/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
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!!!
Answered 09/04/2009 by: AnneWang
Senior Yellow Belt

Please log in to comment
0
look at the wmi class win32_service, it may have it, if not remind me on Tuesday (long weekend!)
Answered 09/04/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
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!
Answered 09/08/2009 by: AnneWang
Senior Yellow Belt

Please log in to comment
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...
Answered 12/17/2009 by: coluhandria
Yellow Belt

Please log in to comment
0
Have you checked that the service allows a recovery option, using the 'Services' applet? Not all services do.
Answered 12/17/2009 by: VBScab
Red Belt

Please log in to comment
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..
Answered 12/18/2009 by: coluhandria
Yellow Belt

Please log in to comment
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!!!
Answered 04/20/2010 by: coluhandria
Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity