Fixed: Updater occasionally killed Sonarr twice before allowing it to be restarted by upstart.

Fixed: Updater killed itself during update on debian jessie.
pull/4/head
Taloth Saldono 9 years ago
parent 103de770c3
commit 1eb6629088

@ -244,6 +244,12 @@ namespace NzbDrone.Common.Processes
foreach (var processInfo in processes)
{
if (processInfo.Id == Process.GetCurrentProcess().Id)
{
_logger.Debug("Tried killing own process, skipping: {0} [{1}]", processInfo.Id, processInfo.ProcessName);
continue;
}
_logger.Debug("Killing process: {0} [{1}]", processInfo.Id, processInfo.ProcessName);
Kill(processInfo.Id);
}
@ -306,6 +312,18 @@ namespace NzbDrone.Common.Processes
_logger.Debug("Found {0} processes with the name: {1}", processes.Count, name);
try
{
foreach (var process in processes)
{
_logger.Debug(" - [{0}] {1}", process.Id, process.ProcessName);
}
}
catch
{
// Don't crash on gettings some log data.
}
return processes;
}

@ -82,6 +82,9 @@ namespace NzbDrone.Update.UpdateEngine
try
{
_processProvider.FindProcessByName(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME);
_processProvider.FindProcessByName(ProcessProvider.NZB_DRONE_PROCESS_NAME);
if (OsInfo.IsWindows)
{
_terminateNzbDrone.Terminate(processId);

@ -44,16 +44,21 @@ namespace NzbDrone.Update.UpdateEngine
_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);
}
else
{
_logger.Info("Killing all running processes");
_processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME);
_processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME);
_processProvider.Kill(processId);
}
_logger.Info("Killing all running processes");
_processProvider.KillAll(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME);
_processProvider.KillAll(ProcessProvider.NZB_DRONE_PROCESS_NAME);
}
}
}
Loading…
Cancel
Save