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.
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)
Please log in to answer
Posted by:
Lindeberg IT
13 years ago
Posted by:
MSIPackager
13 years ago
Posted by:
anonymous_9363
13 years ago
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
13 years ago
Posted by:
jmcfadyen
13 years ago
Posted by:
MSIPackager
13 years ago
Posted by:
AnneWang
13 years ago
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
13 years ago
Posted by:
AnneWang
13 years ago
Posted by:
aogilmor
13 years ago
Posted by:
AnneWang
13 years ago
Posted by:
aogilmor
13 years ago
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 ;-)
But at least it is addressed by the newest windows installer/windows...from what others said ;-)
Posted by:
aogilmor
13 years ago
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
13 years ago
Posted by:
aogilmor
13 years ago
Posted by:
AnneWang
13 years ago
Posted by:
coluhandria
13 years ago
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...
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: 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
13 years ago
Posted by:
coluhandria
13 years ago
Posted by:
coluhandria
12 years ago
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!!!
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!!!

so that the conversation will remain readable.