473,738 Members | 3,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service Recovery Property?

I am creating a new windows service and I would like to control its Recovery
property. On a system administrator level the Recovery property is found in
Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.

Would anyone know if I can (and how) control First, Second Failure property
programmaticall y instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting
the windows service?

Thanks,

--
Strah @ Langan
Nov 16 '05 #1
2 8940
thanks Richard for a guideline
--
Strah @ Langan

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:72******** *************** ***********@mic rosoft.com...

I don't think there is any .NET API to explicitly do this. If there is it
would be hanging off of the ServiceInstalle r class and I don't see one...
BUT the recovery settings are just registry entries so in a worst case
scenario all you'll have to do is add some registry writes to your service
installer/uninstaller logic... I dunno registry keys/values offhand but if you fire up regedit and poke around a service that has non default settings you'll find them...

--Richard

"Strahimir Antoljak" wrote:
I am creating a new windows service and I would like to control its Recovery property. On a system administrator level the Recovery property is found in Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.
Would anyone know if I can (and how) control First, Second Failure property programmaticall y instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting the windows service?

Thanks,

--
Strah @ Langan

Nov 16 '05 #2
I found this page which may answer your question:

A ServiceInstalle r Extension That Enables Recovery and Autostart Configuration
http://www.thecodeproject.com/csharp...stallerExt.asp

Mike Mazar

"Strahimir Antoljak" wrote:
thanks Richard for a guideline
--
Strah @ Langan

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:72******** *************** ***********@mic rosoft.com...

I don't think there is any .NET API to explicitly do this. If there is it
would be hanging off of the ServiceInstalle r class and I don't see one...
BUT the recovery settings are just registry entries so in a worst case
scenario all you'll have to do is add some registry writes to your service
installer/uninstaller logic... I dunno registry keys/values offhand but

if
you fire up regedit and poke around a service that has non default

settings
you'll find them...

--Richard

"Strahimir Antoljak" wrote:
I am creating a new windows service and I would like to control its Recovery property. On a system administrator level the Recovery property is found in Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.
Would anyone know if I can (and how) control First, Second Failure property programmaticall y instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting the windows service?

Thanks,

--
Strah @ Langan


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
434
by: Mike Mazar | last post by:
I have a service which I create in vb.net. I'm trying to use the Recovery feature of Windows 2000/XP to restart the service if it fails to start. Looks like there are some steps that a service must perform for this feature to work, like settings the value of WIN32_EXIT_CODE. Does anyone know how to write a service using .net so it can use Recovery feature of Windows? Thanks Mike
4
15893
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group : microsoft.public.dotnet.languages.csharp URL :...
7
712
by: Mike | last post by:
I want to create a windows service that will monitor another window service. what i need for the service to do is, if a service is stopped I need it to start the service back up example: service 1 - my service watches service 2 - windows service service 2 is stopped - service 1 starts service 2
0
1187
by: Tal | last post by:
Hi, I am using ServiceInstaller in order to install a .Net C# service. How can i configure the service recovery mode using the installer code. I saw that ServiceInstaller contain many properties like StartType, but i didn't find any property on recovery issue.
5
2350
by: Geir Sanne | last post by:
hi!!! i want to make 1 windows service and be able to run like 20 independent instances of this. the main reason i want this is to be able to see the names of the processes running and to be able to restart the processes that has crashed. is it a way to do this ?
1
3697
by: Sergey Krutous | last post by:
Can you please help me to resolve the following issue: I developed a windows service. At start up (I have overriden OnStart method) it connects to a web service and if the connection fails the windows service sets ExitCode property to non-zero value (55) and calls Stop method. If this happens when user starts the service in Services snap-in SCM shows error massage and service stops - it's OK. I configured automatic startup and Recovery...
4
8832
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... Following the samples online, we implemented a windows service in .Net. Like most services, there's a worker thread actually doing stuff in the background. The problem we've run into is how to get the service to exit when the worker thread has a fatal error *and* get the SCM to invoke the auto-restart configuration? The worker thread can error out while the parent thread in the server process chugs along. We can set the exit...
1
4512
by: svandanapu | last post by:
Hi All, I written one windows service and its working fine. I Need to check the recovery settings of that service from one windows application. How do I can get the recovery settings of(first failure, second failure and third failure) a service programatically. can any one please help me in this regard. Thanks in advance Sivakumar V
0
1174
by: Snofkeen | last post by:
I have created a Windows service that tracks the file system and perform actions according to received input. the service is working, though I need to set it's recovery serttings, meaning, I need to set what will occure during first failure + I need to be able to set the fail counter. Is there a way to control these settings from the .Net framework? Is there a different way to be able to recover the service in case of failure?
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.