gpt4 book ai didi

c# - 在 redhat 6 上通过 mono 5.4 启动时 RPM scriptlets 失败

转载 作者:太空宇宙 更新时间:2023-11-04 12:17:23 26 4
gpt4 key购买 nike

我使用此处的过程在 RedHat 6 上安装了 mono 5.4:

http://www.mono-project.com/download/#download-lin-centos

我使用 fpm 创建了一个非常简单的带有 prein scriptlet 的 rpm:

https://github.com/jordansissel/fpm

prein.sh

#!/bin/sh

echo boo

something.sh

#!/bin/sh

echo do something

制作_rpm.sh

fpm -s dir -t rpm -v 1.0 -n test --before-install prein.sh ./something.sh=/usr/bin/something.sh

如果我通过以下方式安装生成的 rpm:

sudo rpm -i test-1.0-1.x86_64.rpm

它工作正常。但是,如果我尝试通过 mono 执行相同操作,安装会因 prein scriptlet 崩溃而失败。

测试.cs

using System;
using System.Diagnostics;

namespace Test
{
class Test
{
static void Main(string [] args)
{
Process p = new Process();

p.StartInfo.FileName = "/bin/rpm";
p.StartInfo.Arguments = "-i test-1.0-1.x86_64.rpm";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

p.Start();

p.WaitForExit();
}
}
}

那是编译做的:

csc test.cs

并使用:

sudo mono test.exe

我得到:

error: %pre(test-1.0-1.x86_64) scriptlet failed, exit status 127
error: install: %pre scriptlet failed (2), skipping test-1.0-1

同样的过程在 CentOS 6 上也有相同的行为。但是,它在 Redhat 7 上按预期工作。这在 RedHat/CentOS6 上也能正常工作,使用以前版本的 mono(特别是 4.0.2)。任何人都知道为什么会发生这种情况以及如何解决这个问题?

最佳答案

好吧 - 最终我不知道问题是什么,但当我从源代码构建 5.4 时它就消失了。甚至 EPEL 的 4.2.4 也出现了这个问题。

关于c# - 在 redhat 6 上通过 mono 5.4 启动时 RPM scriptlets 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47066632/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com