Asdfg
Asdfg

Reputation: 12203

How do i create dependency between two windows services running on separate machines

How do i create dependency between two Windows Services created by me but installed on separate machines. ServiceA is installed on SystemA and ServiceB is installed on SystemB.

I want to make sure that if ServiceA is running then only ServiceB should start.

I know its easy to do if they both are on same machine but since they are on different machines, i am kind of stuck here.

Upvotes: 1

Views: 449

Answers (2)

AngryHacker
AngryHacker

Reputation: 61606

How about simply calling out to serviceB via TCP or Remoting or WCF? If the service does not respond, you end serviceA. And vice versa.

This method would work whether you are on the same machine or across the globe.

Upvotes: 1

Mike Marshall
Mike Marshall

Reputation: 7850

I don't believe there is a way to do this. The dependency list is buried in the registry as a list of null-delimited strings referring to a local service name. The local service names are only allowed to point to local service EXEs or DLLs so I'm pretty sure this is not possible using the service-dependency framework in the service manager.

Upvotes: 0

Related Questions