【问题标题】:RPM scriptlets fail when launched through mono 5.4 on redhat 6在 redhat 6 上通过 mono 5.4 启动 RPM 脚本失败
【发布时间】:2018-04-14 11:10:31
【问题描述】:

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

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

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

https://github.com/jordansissel/fpm

prein.sh

#!/bin/sh

echo boo

something.sh

#!/bin/sh

echo do something

make_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

它工作正常。但是,如果我尝试通过单声道执行相同操作,则由于 prein scriptlet 中的崩溃而导致安装失败。

test.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 和以前版本的单声道(特别是 4.0.2)上也可以正常工作。任何人都知道为什么会发生这种情况以及如何解决它?

【问题讨论】:

  • exit status 127 :找不到 cmd。缺少路径?没有shell环境?等等……

标签: c# linux mono redhat rpm


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-06
    • 1970-01-01
    • 1970-01-01
    • 2015-05-06
    • 2019-09-02
    • 2018-04-29
    • 2019-06-07
    • 2015-05-27
    相关资源
    最近更新 更多