mirror of https://github.com/winsw/winsw
Treat ERROR_SERVICE_CANNOT_ACCEPT_CTRL as success for stop command
parent
ad329b60ca
commit
da2772c6c4
|
@ -728,7 +728,22 @@ namespace winsw
|
|||
if (s is null)
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue