Merge pull request #385 from NextTurn/start

Treat ERROR_SERVICE_ALREADY_RUNNING as success for start command
pull/414/head
Oleg Nenashev 2020-02-11 17:07:57 +01:00 committed by GitHub
commit 7bbe98e326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -718,7 +718,22 @@ namespace winsw
if (s is null)
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;
}