Windows Services don't automatically start after reboot?

57,384

Solution 1

There is a fix for that. See: http://support.microsoft.com/kb/922918

The thing is, a service might require ldap or another remote access an is experiencing delays because of this. This can especially happen when the server is starting. By extending the delay you can ensure the service will start.

Better would of course be to troubleshoot why this service takes so long to start. Is your environment unersized? Have you got performance issues on a service that is being polled by the service being delayed to start?

Solution 2

What do you mean when you say "we've got some Windows services"? That suggest to me that they're created internally by someone within your organisation? If so then you're in a better position to debug them than anyone else here - what dependencies do these services have on windows components and are your programmers considered testing for the availability of these services and waiting for them to come online when your services start?

Have you considered setting these services as a dependency of the software licensing service (that's what slsvc is)?

from http://support.microsoft.com/kb/193888

To create a new dependency, select the subkey representing the service you want to delay, click Edit, and then click Add Value. Create a new value name "DependOnService" (without the quotation marks) with a data type of REG_MULTI_SZ, and then click OK. When the Data dialog box appears, type the name or names of the services that you prefer to start before this service with one entry for each line, and then click OK.

The name of the service you would enter in the Data dialog box is the exact name of the service as it appears in the registry under the Services key.

When the computer starts, it uses this entry to verify that the service or services listed in this value are started before attempting to start the dependent service.

Share:
57,384

Related videos on Youtube

James Crowley
Author by

James Crowley

Co-founder at FundApps and SDD Conf, founder at Developer Fusion

Updated on September 18, 2022

Comments

  • James Crowley
    James Crowley almost 2 years

    We've got some Windows services written in .NET. They start fine manually within the services mmc, but despite being set to Automatic, they never start when powering on (or rebooting) the machine.

    Update In the event log, instead of seeing "xyz started", alongside all the other services starting, I just see "The xyz service entered the stopped state." and a seperate error that says "A timeout (30000 milliseconds) was reached while waiting for a transaction response from the slsvc service.".

    If I manually start them, then I get a normal entry in the event log as expected, and all is fine - until the next Windows Update patch which forces a reboot and all the services are off again.

    Any ideas? I've tried setting them to Delayed Start with no apparent difference.

    • DaveRandom
      DaveRandom over 12 years
      I once had a very similar problem with some scheduled tasks, which I eventually discovered I could recreate by changing the username the task ran as after it had been created. I found that I could easily fix the problem by simply deleting and re-creating the tasks. It is definitely worth a similar approach with this - try removing the service and recreating it. This may help if your not sure how to do that. FYI, the scheduled tasks problem doesn't happen any more, I guess some update at some point fixed it.
    • Ashmeet Singh
      Ashmeet Singh over 12 years
      I'm wondering if they are failing to start because they are dependent on another service (which hasn't started yet). Are you able to see a service start failure within the system log?
    • James Crowley
      James Crowley over 12 years
      @DaveRandom the reinstall actually happens each time we deploy a new version, so it doesn't appear that removing/adding solves the problem unfortunately
    • James Crowley
      James Crowley over 12 years
      @newmanth question updated with some new details - turns out there were event log entries that I'd missed
    • Ashmeet Singh
      Ashmeet Singh over 12 years
      I noticed in your comment to Rob's answer that .NET is the only dependency. Do you know if the developers used any third-party APIs in the service's development? If so, perhaps there is some licensing mechanism that is being blocked?
  • James Crowley
    James Crowley over 12 years
    Thanks Rob - they are internal - but the only dependency is the .NET framework, which I don't believe runs as a service. It doesn't require anything else at startup...
  • Kenny Evitt
    Kenny Evitt over 9 years
    How specifically can service starts be troubleshooted? Is there some way to enable detailed logging?