2

I have Service B that is dependent on Service A. Both services are set for automatic(delayed) start upon boot and both services have set Recovery Action of restart in case of first, second and subsequent failures.

The scenario is:

  1. Windows is booting.
  2. It tries to start Service A.
  3. Service A crashes upon start because it cannot initialize (e.g. connect to remote database).
  4. Recovery Action kicks in and windows keep starting Service A at some intervals.
  5. Service A finally starts fine (e.g. remote db is now accessible).

And that's it, Windows doesn't bother to start Service B despite it having Automatic (delayed) startup type. I'm confused a bit with this behavior. Is there anything I can do to make windows start Service B ?

nosalan
  • 121
  • 1
  • 3
  • 1
    It's possible Windows tries to start both services, but it gives up on Service B because of too many failures; what does the event log says? Services-related events (starts, stops, failures) should be present in the System log. – Massimo Mar 22 '16 at 15:28
  • You say B is dependent on A. Is service A listed as a dependency in the service dependencies tab for service B? – Bin Mar 22 '16 at 16:06
  • Maybe Service A should have a startup type of Automatic (delayed). – Greg Askew Mar 22 '16 at 18:11
  • 1
    4 years later, I confirm Windows 10 has the same behavior. It also happens if Service A starts successfully the first time but takes a very long while (several minutes). Windows does not write any log entries regarding Service B. It simply does not start it. – Moby Disk Feb 06 '20 at 19:29

1 Answers1

0

Service A would not attempt to start if there was a dependency set among the two services. You need to add dependency if it is not there.

sc config ServiceB depend= ServiceA

*How to add dependency on a Windows Service AFTER the service is installed

Bin
  • 844
  • 5
  • 15