2011-06-29 77 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咬你,這也會失敗。