473,761 Members | 8,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2351
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*******@disc ussions.microso ft.com> wrote in message
news:F7******** *************** ***********@mic rosoft.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
6002
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 original service under a new name but the SCM complains that the executable does not have this service implemented. Please note that I need to have distinct instances of executables installed not merely multiple windows services defined within...
1
460
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 original service under a new name but the SCM complains that the executable does not have this service implemented. Please note that I need to have distinct instances of executables installed not merely multiple windows services defined within...
10
4984
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 Instance needs to run in its own process. My current approach to this is to put all the logic into a separate "Worker" assembly and install it into the GAC. I'm then going to create Multiple Windows Services (i.e. MyService1, MyService2 etc..)...
1
1575
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 the app.config file so that the service can be configured to do different things when it's fired up. We have a number of different configurations that aren't compatible with each other and consequently need multiple instances of this service installed...
0
1606
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 multiple instances of the same windows service running. My concern is that will there be any problem when multiple instances will be reading those above mentioned file.I am not writing to any files in the service. If i try to use lock() when...
0
9376
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
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...
0
9988
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
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,...
1
7358
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
5266
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
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.