.NET Framework Bookmark and Share   
 index > .NET StockTrader Sample Application > Service startup on server reboot
 

Service startup on server reboot

Hello,

We ran into some startup issues when rebooting a server, when our the NT service basedservice 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 leastdoesn'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
debrust
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
Gregory Leake

You can use google to search for other answers

Custom Search

More Threads

• recordset.addnew in vb.net
• Configuration Service full source to be published
• The Test Connection Failed
• WinForms service client for ConfigurationService
• 2.03 Release Now Live
• getting ths error when try to execute Upgraderepository.sql
• Performance Test with Capacity Tool, load balancing issues
• Managed Services Engine vs Configuration Service 2.0
• .NET StockTrader Sample Application IMPLEMENATION IN MVVP DESIGN PATTERN
• Installation question