简体   繁体   English

rpm规格文件的安装后脚本中的yum / rpm install命令

[英]yum/rpm install command in post install script of rpm spec file

I would like to create .rpm file with optional dependencies. 我想创建具有可选依赖项的.rpm文件。 ie if "dependency" is not installed because of missing file/network issues, the entire rpm install should not halt. 例如,如果由于缺少文件/网络问题而未安装“ dependency”,则不应停止整个rpm安装。
Whereas in "Weakdependency" section of http://www.rpm.org/wiki/PackagerDocs/Dependencies states that it is not supported by RPM specification. http://www.rpm.org/wiki/PackagerDocs/Dependencies的 “弱依赖性”部分指出RPM规范不支持该功能。 So i want to do turnaround approach by putting optional dependency packages in "post" install script. 因此,我想通过将可选的依赖项软件包放入“后”安装脚本中来执行周转方法。 When i am including "yum install " in the postscript, at the time of execution it is going into waiting state (with no messages), when i killed process it giving messages like this.. 当我在后记中包括“ yum install”时,在执行时它将进入等待状态(无消息),当我杀死进程时,它会发出这样的消息。

Non-fatal POSTIN scriptlet failure in rpm package
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  71 M RSS (365 MB VSZ)
    Started: Wed Mar 18 13:17:45 2015 - 00:16 ago
    State  : Sleeping, pid: 3870

Required packages are getting installed properly with this error in optional dependencies. 正确安装了必需的软件包,并在可选依赖项中出现此错误。 I think it is going to deadlock situation as both yum processes are waiting for completion of others. 我认为这将陷入僵局,因为两个yum过程都在等待其他过程的完成。
Is there any better way to fix this type of optional dependency issue in RPM standard? 有什么更好的方法可以解决RPM标准中这种类型的可选依赖项问题?

I would create a shell script that does what you need and leave 'yum' out of your spec file because of this problem ( package installtion issue , rpm spec file , which include yum to install dependence ). 由于这个问题,我会创建一个shell脚本来执行所需的操作,并在规范文件中保留“ yum”( 软件包安装问题,rpm规范文件,其中包括yum来安装依赖项 )。

In the shell script (similar to any install.sh script), have it check on optional dependencies and install them if needed along with the RPM described in your post. 在shell脚本(类似于任何install.sh脚本)中,让它检查可选的依赖项,并根据需要与帖子中描述的RPM一起安装它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM