Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set Remote Service as Dependency

87 views
Skip to first unread message

Masthi

unread,
Feb 12, 2008, 2:08:36 PM2/12/08
to
Hi,
I have a requirement where in I need to start my application service
in local computer only after my SQL Service starts on a remote
computer. In Service control panel I can set the dependency for my
service if the SQL Server is running on the same computer. But in this
case where my SQL Server is running on a remote computer I am facing
difficulty. Any help would be greatly appreciated. I am using Windows
2003 server.
Thanks
Masthi

Sten Westerback (MVP SDK 2005-6 :)

unread,
Apr 2, 2008, 10:02:10 PM4/2/08
to

"Masthi" <masth...@gmail.com> wrote in message
news:86626d7f-138e-4e84...@i12g2000prf.googlegroups.com...

I haven't heard of such a feature in Windows nor have i seen a helper
service pair that would wait for a service on one server and ask it's
counterpart service on another server to continue it's startup (so that your
service can depend on it) or start another service (yours).

If i were you i would just let the service start and poll for the SQL and
then let activities commence when the SQL is available. Note that your
service should cope with SQL server shutdowns and network problems anyways
so you can as well use a (named) mutex (if 1 at a time is enough), event
(any amount of connections at ones) or a semaphore (n simultaneous
threads/connections). Or you could use a thread that performs enqueued
queries. Or ofcourse you could just retry+Sleep(60000) -loop.

Or you could make a helper service that is started after SQL service and
post a message to your service. But ofcourse you won't get the message if
the server was already running when your non-sql-server service starts so
you would end up trying the sql connect anyway...

- Sten


0 new messages