Closed Sigman32 closed 6 years ago
Hi,
If you take a peek here: https://github.com/jabbera/my-vsts-tasks/blob/29985358579f799244e4be5f80a3e2c0180da436/Extensions/WindowsServiceReleaseTasks/Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1#L39
You will see that the startup type has nothing to do with the service is stopping or not. Additionally if the service fails to stop, an exception is thrown and we would log it and force the process to terminate (as you have force kill set).
If the process is still in running after the stop task finishes (and it’s files are still busy) this typically means the service has returned from OnStop() but there are still non background threads running holding the process open. OnStop cannot exit until all non background threads are terminated.
Let me know if you are seeing something else.
Mike
I tried setting service to disabled startup type, and stopping it, but service was not stopped, and next release step failed.
Here are task logs:
and psversiontable:
However using Manual or Automatic as startup type actually stops service, and process.