mirror of https://github.com/winsw/winsw
Treat ERROR_SERVICE_ALREADY_RUNNING as success for start command
parent
ad329b60ca
commit
16205acbc8
|
@ -718,7 +718,22 @@ namespace winsw
|
||||||
if (s is null)
|
if (s is null)
|
||||||
ThrowNoSuchService();
|
ThrowNoSuchService();
|
||||||
|
|
||||||
s.StartService();
|
try
|
||||||
|
{
|
||||||
|
s.StartService();
|
||||||
|
}
|
||||||
|
catch (WmiException e)
|
||||||
|
{
|
||||||
|
if (e.ErrorCode == ReturnValue.ServiceAlreadyRunning)
|
||||||
|
{
|
||||||
|
Log.Info($"The service with ID '{descriptor.Id}' has already been started");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue