我是 systemd 的新手,并试图将内部应用程序打包为 rpm,以安装在 systemd 主机(RHEL7)上。
rpm 尝试将 systemd .service-file: myapp.service 放入:/etc/systemd/system
但这会产生错误,我不明白:
file /etc/systemd from install of myapp-0:1-.i386 conflicts with file from package systemd-219-19.el7.x86_64
file /etc/systemd/system from install of myapp-0:1-.i386 conflicts with file from package systemd-219-19.el7.x86_64
Run Code Online (Sandbox Code Playgroud)
并且安装中止。
.service-file 中与安装相关的内容是:
[Unit]
Description=MyApp
After=syslog.target network.target activemq.service
Requires=activemq.service
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
...
Run Code Online (Sandbox Code Playgroud)
知道冲突可能是什么吗?
或者如何解决?
编辑:从 gradle 构建文件添加 rpm-stuff:
myappRpm {
dependsOn build
packageName 'myapp'
arch I386
os LINUX
version buildVersion
preInstall file('./deploy/rpm/preinstall')
postInstall file('./deploy/rpm/postinstall')
preUninstall file('./deploy/rpm/preuninstall')
directory('/var/log/myapp', 755)
directory('/opt/myapp/app', …
Run Code Online (Sandbox Code Playgroud)