1

This is the Microsoft Document

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc756379%28v%3dws.10%29

Service Control Manager transmits control requests to running services and driver services. It also maintains status information about those services, and reports configuration changes and state changes.

I got few questions

  1. How frequently Service control Manager transmits Control request, does it check at regular intervals or for any changes?
  2. I noticed once the SCM sends a request the service will enter running or stopping state without any user intervention or any failure action configured?

Regards

  • SCM manages a database of services under HKLM\System\CurrentControlsetX\services. Developers use API calls to interact with the SCM, e.g. CreateService, StartService, etc.. (msdn.microsoft.com/library/windows/desktop/ms682450(v=vs.85).aspx or you can use a command line tool such as sc.exe as a wrapper to interact with the SCM. Services have config such as if they autostart, delay start, which account they run as, any recovery options, security etc.. Once the service is installed, you can make calls to the SCM to stop/start/pause, etc.. These calls again are API calls such as StartService, etc. – HelpingHand Jun 20 '18 at 16:45
  • I'm not sure I understand what you're asking, but the service itself is responsible for reporting any changes in its status to the SCM. This usually happens in response to a control request from the SCM, e.g., stop, pause, continue, but can also be spontaneous, e.g., I wrote a service that waits 15 minutes after being started before taking any action, and it sets the status to "paused" while it is waiting, and then to "running" when the wait is finished so that I can tell the difference. – Harry Johnston Jun 21 '18 at 0:31
  • @HarryJohnston , I guess control request as any user or automated request for that particular service like start the service, stop the service etc . – Karamzov Jun 21 '18 at 2:40
-1

How frequently Service control Manager transmits Control request,

Why would it transmit control requests in ANY interval? It sends them when a control request is needed (i.e. user presses stop).

I noticed once the SCM sends a request the service will enter running or stopping state without any user intervention or any failure action> configured?

Yes. Is there a question here? Obiously - Service running, gets stp control request, status is shown as stopping. What is the question?

|improve this answer|||||
  • What if I kill the underlying .exe (for example)? How does the Windows-service recognize its program has been "killed"? – Lenniey Jun 20 '18 at 9:48
  • You are aware the service IS the exe? and the OS tracks what programs run? – TomTom Jun 20 '18 at 9:53
  • svchost.exe is the executable of many services (which are run from DLLs instead of the exe) in the services database. However, if I kill one of them, it only "stops" the corresponding service, not all of the ones using svchost.exe. – Lenniey Jun 20 '18 at 10:09
  • in my event logsi receive error 7011 saying ` timeout was reached while connecting to the service `but my service was running and online.what does that mean? is my scm cannot reach the service – Karamzov Jun 20 '18 at 11:22
  • @Karamzov, typically those sorts of errors are due to programming errors in the service. It can also happen when someone tries to install a non-service executable as a service. – Harry Johnston Jun 21 '18 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.