Score:1

Windows service starts again after manually stopping it. Why?

us flag

I have a Windows service that is a custom API, it is running on Windows Server 2019.

When I manually stop it, it stops, but about 30 seconds later it restarts. The restarted service has a new PID. Setting the service to Automatic or Manual makes no difference: it still restarts. If I install the service on a different machine, a Windows 10, when I stop it, it stops permanently.

I have read that a manual service can be triggered to start, could this be what is happening? How might I find what triggers it?

Any idea what may be restarting it? How can I find what is restarting it? In the event log I notice there is always BITS activity around the Start/Stop events. Is this a coincidence?

GDutton avatar
us flag
I think I have verified that it is BITS restarting it, but i'm not sure why
Score:0
cn flag

A service can be started by another service which uses it. Have you check in the services configuration applet if your custom service is related with BITS or with any other service that could be using it? Check in the recovery tab for your service configuration if the options there could be restarting it.

Is hard to affirm if BITS service is related with your custom service, but if there is a service dependence then that could be the reason for it be restarted. In your windows 10 computer, it can be disabled or the service dependence is not present. You can read more about BITS service here.

I found this and this documents about how to create a windows service application. I hope they could be helpful if there is something to check in your custom service.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.