2011-06-29 73 views
1

我使用maven rpm插件(2.1-alpha-1)创建了一个rpm文件。我需要在rpm文件的%post中执行两个命令。生成的spec文件和命令“rpm -q --scripts filename”显示了这两个命令。 这里是“的输出转速-q --scripts文件名|少”rpm post安装命令不执行

postinstall scriplet (using /bin/sh): 
ln -s /etc/init.d/source /etc/init.d/target 
ln -s /var/app/source1 /var/app/target1 

这里是指令如何在转速插件部

<postinstall>ln -s /etc/init.d/source /etc/init.d/target 
    ln -s /var/app/source1 /var/app/target1</postinstall> 
    <!-- I have tried to separate the two commands with ";" 
too but that does not work either.--> 

但是只有第二个被执行给定的。我在这里失踪的任何东西?任何解决方法来完成这项工作?提前致谢。

+0

嗯......我们确定第二个ln没有执行吗?还是无法创建链接? – thekbb

+0

第二个ln得到执行并创建链接,但第一个不是 – rpmguy

+0

顺便说一句,你的例子是不正确的:'ln'参数是错误的,因为第一个参数应该指定目标,而不是源文件。 –

回答

0

也许这不是包装问题。相反,SELinux可能会在目标系统上启用,并且可能会阻止创建链接,因此请检查/var/log/audit/audit.log以查看是否正在生成任何拒绝消息。

您可能还想要在目标系统上以root身份手动尝试'ln -s /etc/init.d/source /etc/init.d/target'。如果SELinux咬你,这也会失败。