Windows — Services: Part 2

Shlomi Boutnaru, Ph.D.
2 min readAug 30, 2022

--

In addition to part 1 (https://medium.com/@boutnaru/windows-services-part-1-5d6c2d25b31c), there are two more configuration options I am going to talk about: dependency management and recovery handling. In the screenshot below an example of those configurations are shown regarding the “DHCP Client” service (from services.msc). It is time to deep dive into it, so let’s go.

In the case of dependency management in the configuration of each service there is a list of dependent services and the list of the services that depend on it. Those lists are checked by the SCM when starting and stopping services.

Regarding recovery, the configuration allows setting actions for first/second/subsequent failures. The action could be to restart the service/the computer or execute an arbitrary command. We could also reset the fail count after N (we can set it) days and enable actions for cases the service stops with errors.

All the configurations of services are saved as part of the Registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services). It is important to know that kernel drivers configuration is also stored there (we will go over it as part of the SCM discussion).

Next we are going to check out the SCM (Service Control Manager) which is the OS part responsible for managing all the services and their configuration.

You can also check my twitter account @boutnaru (https://twitter.com/boutnaru) — for more stuff on Windows/Linux/etc.

See you soon ;-)

--

--