mirror of
https://github.com/actions/runner.git
synced 2025-12-11 04:46:58 +00:00
Verify that has Windows service started successfully (#236)
This commit is contained in:
@@ -678,6 +678,17 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
if (service != null)
|
if (service != null)
|
||||||
{
|
{
|
||||||
service.Start();
|
service.Start();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_term.WriteLine("Waiting for service to start...");
|
||||||
|
service.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(60));
|
||||||
|
}
|
||||||
|
catch (System.ServiceProcess.TimeoutException)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"Cannot start the service {serviceName} in a timely fashion.");
|
||||||
|
}
|
||||||
|
|
||||||
_term.WriteLine($"Service {serviceName} started successfully");
|
_term.WriteLine($"Service {serviceName} started successfully");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user