Ask a questionAsk a question
 

QuestionService startup on server reboot

  • Thursday, September 17, 2009 2:30 AMdebrust Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    We ran into some startup issues when rebooting a server, when our the NT service based service tries to connect to sql server to get its configuration data, sql server is not yet running.  Creating a startup dependency on MSSQLSERVER at the very least doesn't seem reliable; it seems that the service reports as started before the databases are actually available, so it still fails.  This of course puts everything in a failed state, although when you first look at the service snap-in, things appear to be running.  Anyone have a good solution for this so far?

    Maybe a more interesting question, what happens when you restart a machine that a configuration based service is on and the sql server instance that holds the repository is remote, and also off?

    Thanks,
    Darren

All Replies

  • Tuesday, September 22, 2009 7:00 PMGregory Leake Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    One idea might be to create a separate service that first checks the status of the config DB; if ok, it then launches a service start (not sure how this is done syntactically, but sure it is possible) on the main service.  If the config DB is not active; it would launch a timer thread, and repeat the check every 60 seconds or so.

    Since IIS services are on-demand;  I do not think this would not be an issue with an IIS-hosted service; since worker pools are started automatically; if the process fails to start becuase of a db connection issue; I believe the retry logic is already there so an attempt to re-init is made each time a client tries to connect to the service.

    -Greg
    Greg Leake, Microsoft