|
|
|
@ -27,7 +27,7 @@ namespace NzbDrone.Common
|
|
|
|
|
|
|
|
|
|
public class ProcessProvider : IProcessProvider
|
|
|
|
|
{
|
|
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger();
|
|
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger();
|
|
|
|
|
|
|
|
|
|
public const string NZB_DRONE_PROCESS_NAME = "NzbDrone";
|
|
|
|
|
public const string NZB_DRONE_CONSOLE_PROCESS_NAME = "NzbDrone.Console";
|
|
|
|
@ -213,7 +213,7 @@ namespace NzbDrone.Common
|
|
|
|
|
return new ProcessInfo
|
|
|
|
|
{
|
|
|
|
|
Id = process.Id,
|
|
|
|
|
StartPath = process.MainModule.FileName,
|
|
|
|
|
StartPath = GetExeFileName(process),
|
|
|
|
|
Name = process.ProcessName
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
@ -225,6 +225,17 @@ namespace NzbDrone.Common
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static string GetExeFileName(Process process)
|
|
|
|
|
{
|
|
|
|
|
if (process.MainModule.FileName != "mono.exe")
|
|
|
|
|
{
|
|
|
|
|
return process.MainModule.FileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return process.Modules.Cast<ProcessModule>().FirstOrDefault(module => module.ModuleName.ToLower().EndsWith(".exe")).FileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Kill(int processId)
|
|
|
|
|
{
|
|
|
|
|
var process = Process.GetProcesses().FirstOrDefault(p => p.Id == processId);
|
|
|
|
|