473,410 Members | 1,950 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,410 software developers and data experts.

how to run multiple instances of a windows service

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 ?
Nov 23 '05 #1
5 2333
This is kind of a loaded question; running 20 instances of the same
executable for crash-proofing is like using 20 garbage trucks to pick up the
trash in your kitchen trash container. There are much more robust ways to
wire up a single service for crash-proofing, not limited to good exception
handling, Syslog messaging, and setting the recovery options in the Service
Manager to restart the service if it fails.

Having said that, the only requirement is that the ServiceName property in
the installer and the Windows service class must be different. And of course,
the actual executables must be located in separate folders.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Geir Sanne" wrote:
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 ?

Nov 23 '05 #2
hi!!!

ok. so you suggest that i run several services in the same process ?
how do i restart the services that crash ?

Geir Sanne
"Peter Bromberg [C# MVP]" wrote:
This is kind of a loaded question; running 20 instances of the same
executable for crash-proofing is like using 20 garbage trucks to pick up the
trash in your kitchen trash container. There are much more robust ways to
wire up a single service for crash-proofing, not limited to good exception
handling, Syslog messaging, and setting the recovery options in the Service
Manager to restart the service if it fails.

Having said that, the only requirement is that the ServiceName property in
the installer and the Windows service class must be different. And of course,
the actual executables must be located in separate folders.

Nov 23 '05 #3
"Geir Sanne" <Ge*******@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
ok. so you suggest that i run several services in the same process ?


I think, with respect, that Peter is not suggesting that at all, but rather
suggesting that you take a step back here and fix the bugs that are causing
your service to crash in the first place...
Nov 23 '05 #4
> how do i restart the services that crash ?

Via the Service Control Manager dialog, right click the service, goto the
recovery tab, and change the
First failure, Second Failure and Subsequent failure drop downs.
If you want code to do this, let me know and I can post it.
Dave
Nov 23 '05 #5
i finally got everything to work.

what i had to do is subclass my testservice
myservice1 through myservice30 is subclassed from testservice.

then i can read from a config file how many of the myserviceX services i
should install. is it a better way to do this ?

the second problem is that i might want to delete som services or install
new ones.
how can i do this without stopping the other services ?

-Geir
"D. Yates" wrote:
how do i restart the services that crash ?


Via the Service Control Manager dialog, right click the service, goto the
recovery tab, and change the
First failure, Second Failure and Subsequent failure drop downs.
If you want code to do this, let me know and I can post it.
Dave

Nov 25 '05 #6

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

Similar topics

1
by: Vlad | last post by:
Is there any way to install multiple instances of the same windows service designed with VS.NET 2003? I tried copying the binaries into a separate folder and then copying registry entries for the...
1
by: Vlad | last post by:
Is there any way to install multiple instances of the same windows service designed with VS.NET 2003? I tried copying the binaries into a separate folder and then copying registry entries for the...
10
by: John | last post by:
I currently have a Windows Service that runs Transactions that are very Processor/Memory Intensive. I have a requirement to deploy multiple instances of the Web service on the Same server. Each...
1
balabaster
by: balabaster | last post by:
Hi, I'm trying to figure out how to install multiple instances of a Windows Service on a single machine using the deployment Setup Project. We have a Windows Service that's configurable through...
0
by: jigsmshah | last post by:
I have a windows service developed in C#.I am reading the connection string from an ini file and also i am reading 3 image file from the bin directory. now the new requirement is that there will be...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.