I have created an RPM for a piece of software my team is building. The installation works great, but I'm adding in logic to make the software uninstall and restore the system to a working state.
As part of the install, I have to place a configuration file on the file system. However, when I uninstall the RPM, this file is left in the directory, which causes the service to function incorrectly once our package is uninstalled.
.SPEC file:
%files
...
%attr(640, tomcat, tomcat) /var/lib/owf/lib/OWFsecurityContext.xml
...
Install log:
cat Install.log | grep "OWFsecurityContext"
...
D: fini 100640 1 ( 498, 501) 2336 /var/lib/owf/lib/OWFsecurityContext.xml;53a41ad5
...
Files owned by RPM:
$ rpm -ql OurToolName | grep "OWFsecurityContext"
/var/lib/owf/lib/OWFsecurityContext.xml
Uninstall Log
$ cat Remove.log | grep "OWFsecurityContext"
D: fini 100640 1 ( 498, 501) 2336 /var/lib/owf/lib/OWFsecurityContext.xml skip
Why is RPM "skip"ing this file? Is there a way (besides just forcing a remove in the %postun section) to tell RPM to remove this file, just like all of the other files it owns?
EDIT:
After @EtanReisner 's comments, it appears that the file is owned by two packages: the package which I created in this question (by explicit file reference in the %files section, and by the OWF install RPM, which owns the entire directory in which the file lives.
Given that the file ends up being owned by two packages, is there a way to explicitly tell RPM to remove it regardless of its status besides removing it by force in the %postun scriptlet?
%filessection of the spec file? What does 'rpm -V OurToolName` say before you uninstall the package? - Etan Reisner%config. The file is only mentioned once, as shown in the question.rpm -V OurToolNamereturns:S.5....T. /usr/share/tomcat/apache-tomcat-7.0.42/webapps/OurTool/WEB-INF/spring.properties, which is expected, since I modify that file in the%post%scriptlet. - shawmanz32narpm -qf /var/lib/owf/lib/OWFsecurityContext.xmlis:owf-7.0-1.noarch OurToolName-1.0.0.0.0-noarchI have updated the question to ask if there is a way to tell RPM to remove that file, regardless of its ownership. - shawmanz32na