public static bool StopServerService() { bool result = true; if (stop != null) { stop.Set(); } var service = Service_Functions.GetServiceController(ApplicationNames.TRAKHOUND_SERVER_SEVICE_NAME); if (service != null) { Console.WriteLine("Stopping Server Service..."); if (service.Status == System.ServiceProcess.ServiceControllerStatus.Running) { service.Stop(); } service.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 30)); if (service.Status != System.ServiceProcess.ServiceControllerStatus.Stopped) { result = false; } else { Console.WriteLine("Server Service Stopped"); } } return(result); }
private static void StartConsole() { // Check to see if Server Service is Running var serverStatus = Service_Functions.GetServiceStatus(ApplicationNames.TRAKHOUND_SERVER_SEVICE_NAME); if (serverStatus == ServiceStatus.Running) { serverServiceWasRunning = true; } if (StopServerService()) { StartServers(); } else { Console.WriteLine("Error :: Server Service Could Not Be Stopped :: Aborting Console"); } }
private void ServerMonitor_GUI() { ServerStatus = Service_Functions.GetServiceStatus(ApplicationNames.TRAKHOUND_SERVER_SEVICE_NAME); ServerRunning = Service_Functions.IsServiceRunning(ApplicationNames.TRAKHOUND_SERVER_SEVICE_NAME); ServerInstalled = Service_Functions.IsServiceInstalled(ApplicationNames.TRAKHOUND_SERVER_SEVICE_NAME); }
private void ServerMonitor_GUI() { AgentServiceStatus = Service_Functions.GetServiceStatus(Names.AGENT_SERVICE_NAME).ToString(); IsAgentStarted = Service_Functions.IsServiceRunning(Names.AGENT_SERVICE_NAME); }
private static bool CheckUpdaterIsRunning() { return(Service_Functions.IsServiceRunning(ApplicationNames.TRAKHOUND_UPDATER_SEVICE_NAME)); }
private void ServerMonitor_GUI() { ServiceStatus = Service_Functions.GetServiceStatus(ServiceName).ToString(); IsStarted = Service_Functions.IsServiceRunning(ServiceName); }