Multiple Instances of a Service
November 3, 2005 1:15 PM   Subscribe

How do I run multiple instances of a service on Windows Server 2003?

I've got a program that runs as a service. I can't install it more than once, but would like to run mulitple instances on the same machine. Is this possible? I've read a little about Virtualization, but this seems A) Expensive and B) Probably beyond my ability to manage. Any suggestions, or do I need to buy Virtualization software, or some third, much better option...
posted by bob bisquick to Computers & Internet (5 answers total)
 
Depends. What kind of service is it? Is it network-facing? Does it use a certain port?

Unless the service supports it inhierently, this is probably going to be a major hackjob. You'll need to duplicate the executable files, hope that it doesn't write out to anything other than the directory the exe runs in, and heaven help you if it writes to the registry.

Basically, if the program has any file or registry paths hard-coded in, you're kinda screwed.

The official Microsoft solution would be to buy Virtual Server 2003 (2k5 when it comes out). Yes, it is expensive, but if you're a competent Windows administrator (know how to make your scripts run against multiple remote machines?) then you'll be fine.

Another option would be, of course, to just get some other (maybe cheaper) server boxes to run only this service.
posted by chota at 1:20 PM on November 3, 2005


Logically something that would use multiple instances doesn't make sense as a service... if you go through the installed services, there's nothing there you'd want to run multiple times.

That said...

If you have access to the source, services are registered by their UUID (and probably should have a distinct label in the service's .rc file [if you're using the ATL service wizard...]). You could make a copy of the project, change the UUID, make sure you weren't competing for resources, and install it again, but you should really be asking yourself why.
posted by devilsbrigade at 1:28 PM on November 3, 2005


I think this could probably be done by editing the registry. Open up HKLM\system\CurrentControlSet\Services and find the key corresponding to your service. Export it, open the .reg file in notepad, and give it a different name, and also change the DisplayName value. Save the .reg file and import into the registry.

Not sure if this would work, but could be worth a try depending on what the service does.
posted by sanko at 4:53 PM on November 3, 2005


It *needs* to have a separate UUID, I'm almost certain. COM will cry if you have two running services with the same UUID.
posted by devilsbrigade at 8:11 PM on November 3, 2005


This question is too vague to be answered. If it's a network service then you could conceivably do this by hacking up the registry to run a second copy on another port. But in the general case there are all sorts of reasons why this might not work (such as software not designed to run more than one instance - named pipes, shared memory regions, UUIDs, file locking - it goes on and on) and so we'd need specific details of what precisely you're trying to do.
posted by Rhomboid at 12:55 PM on November 4, 2005


« Older Zeitgeist : Time :: ? : Place   |   A comprehensive review repository for books? Newer »
This thread is closed to new comments.