我正在使用SBT native packager 1.2.0-M3将Play Framework 2.5.3应用程序打包为RPM(针对带有systemd的RHEL 7)。 我想更改生成的RPM的行为,使其在安装后不会自动启动但是正在启用( systemctl enable <name>.service )。
我一直在遵循http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/customize.html中列出的说明。 具体来说,我创建了一个文件src/rpm/scriptlets/post-rpm其中包含单行systemctl enable <name>.service 。 据我了解文档,这就是所需要的。 但是,在安装RPM时,服务仍会自动启动。 是否需要其他配置?
I'm using SBT native packager 1.2.0-M3 for packaging a Play Framework 2.5.3 application as an RPM (targeted for RHEL 7 with systemd). I would like to change the behavior of the generated RPM such that it does NOT automatically start after install but is being enabled (systemctl enable <name>.service).
I've been following the instructions outlined at http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/customize.html. Specifically, I created a file src/rpm/scriptlets/post-rpm containing a single line systemctl enable <name>.service. As far as I understand the documentation, that's all that is required. However, on installation of the RPM the service gets still automatically started. Is there any additional configuration required?
最满意答案
这是当前的默认行为。 这里有一个历史的解释。
你真正需要做的是maintainerScripts in Rpm中的maintainerScripts in Rpm 。 有一个帮助器特性可以减轻构建定义。 就像是
import RpmConstants._ maintainerScripts in Rpm := { (maintainerScripts in Rpm).value += ( Post -> "systemctl enable <name>.service" ) }并且有一个功能请求直接在native-packager中实现它。
This is currently the default behaviour. There is a historical explanation here.
What you actually need to do are the maintainerScripts in Rpm. There is a helper trait which lightens the build definition. Something like
import RpmConstants._ maintainerScripts in Rpm := { (maintainerScripts in Rpm).value += ( Post -> "systemctl enable <name>.service" ) }And there is a feature request to implement this in native-packager directly.
更多推荐
发布评论