I am new to systemd, and trying to get an in-house app packaged as rpm, to install on systemd host (RHEL7).
The rpm tries to place the systemd .service-file: myapp.service into: /etc/systemd/system
But that generates an error, I dont understand:
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
and the installation aborts.
The install-related contents from .service-file is:
[Unit]
Description=MyApp
After=syslog.target network.target activemq.service
Requires=activemq.service
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
...
Any idea what the conflict might be?
Or how to troubleshoot?
EDIT: Adding the rpm-stuff from gradle build-file:
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', 755)
directory('/opt/myapp/bin', 755)
directory('/opt/myapp/config', 755)
into '/opt/myapp'
from('MyApp/build/libs/MyApp.war') {
into '/opt/myapp/app/'
fileMode 0755
}
from('deploy/systemd/myapp.sh') {
into '/opt/myapp/bin/'
fileMode 0755
}
from('deploy/systemd/myapp.env') {
into '/opt/myapp/systemd/'
fileMode 0755
}
from('deploy/systemd/myapp.service') {
into '/etc/systemd/system/'
fileMode 0755
}
doLast {
file("$buildDir/distributions/myapp-${buildVersion}.i386.rpm").renameTo("$buildDir/distributions/myapp.rpm")
}
}