I'm trying to build an RPM for our program and running into some issues. I'm trying to run the sed
and ln
commands as a script in the postinstall/preremove and they don't seem to be making any changes. We are using the maven rpm plugin to build the RPM. I read somewhere that turning selinux off might help but it still doesn't work. We are using CentOS 7.
from the pom.xml:
<postinstallScriptlet>
<script>sed -i 's/foo/bar/g' /path/to/file</script>
</postinstallScriptlet>
<preremoveScriptlet>
<script>sed -i 's/bar/foo/g' /path/to/file</script>
</preremoveScriptlet>
This works when I run it by hand but not as part of the rpm