【发布时间】:2017-12-13 09:11:18
【问题描述】:
在 Linux 上运行我的 .Net Core 应用程序时遇到以下问题。
这是一个例外:
System.ComponentModel.Win32Exception (0x80004005): Permission denied
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Ombi.Schedule.Jobs.Ombi.OmbiAutomaticUpdater.<Update>d__18.MoveNext() in C:\projects\requestplex\src\Ombi.Schedule\Jobs\Ombi\OmbiAutomaticUpdater.cs:line 218
代码如下:
var updaterFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
"TempUpdate", $"Ombi.Updater");
var start = new ProcessStartInfo
{
UseShellExecute = false,
CreateNoWindow = true,
FileName = updaterFile,
Arguments = GetArgs(settings), // This just gets some command line arguments for the app i am attempting to launch
WorkingDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "TempUpdate"),
};
using (var proc = new Process { StartInfo = start })
{
proc.Start();
}
好像是在调用.Start()的时候抛出了异常。
我不知道为什么会这样,文件和文件夹的权限已设置为 777。
【问题讨论】:
-
这是一个独立的部署
-
如果有人需要帮助,这篇文章的最后一个答案帮助了我stackoverflow.com/questions/45132081/…
-
您的 .NET 代码看起来不错。我将首先使用一些已知的内置工具(例如“/bin/ping google.com”)测试您的代码,以确认该问题与 ACL 相关。此外,检查 Ombi 树中较高的所有父目录。更新程序具有执行权限。您可以在 Unix & Linux 和 Ask Ubuntu StackExchange 站点中查找更多信息。
-
也许上传一个压缩包?
-
您是否检查过您的 SELinux 或您的发行版中的任何内容?关闭它只是为了测试,看看它是否会工作。