473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Service and Recovery

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
Nov 22 '05 #1
1 2447
Ok, I answer my question:

I talked to Microsoft technical support and apparently, it's not a good idea
to use "Service Recovery" feature of Windows 2000/XP. Here is what I did
after getting ideas from them:
- In OnStart event, create a new thread to initialize the service. This way
the "Service Start" will be successful.
- If it fails (for example, because SQL server is not ready yet), use
Thread.Sleep to wait for some time and then try to initialize the service
again.
- You can choose the number of retries and delay between each.
- You have the option to stop your service after certain number of retries.
- You may want to log each retry in the event log, along with how many times
you will retry, and delay between each retry.

"Mike Mazar" wrote:
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

Nov 22 '05 #2

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

Similar topics

1
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...
15
by: brent | last post by:
I have a laptop with windows xp 1 gig ram 2.0 pentium M. When I run the db2 personal edition version 8.2 the install gets to the first screen and says windows installer is preparing to install. ...
4
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 :...
7
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: ...
2
by: Strahimir Antoljak | last post by:
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 ->...
1
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...
4
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...
7
by: Peter Bradley | last post by:
Hi, I'm writing a Web service (the first one I've ever written in anger, by the way) that has to do some AD manipulation and then has to create some directories on some remote servers. Doing...
1
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...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.