public void Terminate(int processId) { if (OsInfo.IsWindows) { _logger.Info("Stopping all running services"); if (_serviceProvider.ServiceExist(ServiceProvider.SERVICE_NAME) && _serviceProvider.IsServiceRunning(ServiceProvider.SERVICE_NAME)) { try { _logger.Info("NzbDrone Service is installed and running"); _serviceProvider.Stop(ServiceProvider.SERVICE_NAME); } catch (Exception e) { _logger.Error(e, "couldn't stop service"); } } _logger.Info("Killing all running processes"); _processProvider.KillAll(ProcessProvider.LIDARR_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.LIDARR_PROCESS_NAME); } else { _logger.Info("Killing all running processes"); _processProvider.KillAll(ProcessProvider.LIDARR_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.LIDARR_PROCESS_NAME); _processProvider.Kill(processId); } }
public void Terminate(int processId) { if (OsInfo.IsWindows) { _logger.Info("Stopping all running services"); if (_serviceProvider.ServiceExist(ServiceProvider.OmbiServiceName)) { try { _logger.Info("Ombi Service is installed and running"); _serviceProvider.Stop(ServiceProvider.OmbiServiceName); } catch (Exception e) { _logger.Error(e, "couldn't stop service"); } } _logger.Info("Killing all running processes"); _processProvider.KillAll(ProcessProvider.OmbiProcessName); } else { _logger.Info("Killing all running processes"); _processProvider.KillAll(ProcessProvider.OmbiProcessName); _processProvider.Kill(processId); } }
public void Terminate(int processId) { if (OsInfo.IsMono) { _logger.Info("Stopping all instances"); _processProvider.Kill(processId); _processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME); return; } _logger.Info("Stopping all running services"); if (_serviceProvider.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME) && _serviceProvider.IsServiceRunning(ServiceProvider.NZBDRONE_SERVICE_NAME)) { try { _logger.Info("NzbDrone Service is installed and running"); _serviceProvider.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME); } catch (Exception e) { _logger.ErrorException("couldn't stop service", e); } } _logger.Info("Killing all running processes"); _processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME); }
public void KillAll() { if (_nzbDroneProcess != null) { _processProvider.Kill(_nzbDroneProcess.Id); } _processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME); }
public void KillAll() { try { if (_nzbDroneProcess != null) { _processProvider.Kill(_nzbDroneProcess.Id); } _processProvider.KillAll(ProcessProvider.GAMEARR_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.GAMEARR_PROCESS_NAME); } catch (InvalidOperationException) { // May happen if the process closes while being closed } TestBase.DeleteTempFolder(AppData); }
public void KillAll() { _processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME); _processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME); }