mirror of https://github.com/winsw/winsw
Merge pull request #387 from NextTurn/stop
Treat ERROR_SERVICE_CANNOT_ACCEPT_CTRL as success for stop commandpull/414/head
commit
3753bce369
|
@ -743,7 +743,22 @@ namespace winsw
|
||||||
if (s is null)
|
if (s is null)
|
||||||
ThrowNoSuchService();
|
ThrowNoSuchService();
|
||||||
|
|
||||||
s.StopService();
|
try
|
||||||
|
{
|
||||||
|
s.StopService();
|
||||||
|
}
|
||||||
|
catch (WmiException e)
|
||||||
|
{
|
||||||
|
if (e.ErrorCode == ReturnValue.ServiceCannotAcceptControl)
|
||||||
|
{
|
||||||
|
Log.Info($"The service with ID '{descriptor.Id}' is not running");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue