Description of problem: (moving from https://github.com/openshift/origin-server/issues/977) Right now openshift-origin-broker overwrites /var/log/openshift/user_action.log on upgrade. It's not as simple as marking that file as %ghost since if the file isn't created with the proper SELinux context the broker will not be able to write to it. Also, currently the broker does not create that file. In order to correctly label it as %ghost we'll need the broker to handle creating that file.
Actually there's already a %post to create the files correctly as needed. https://github.com/openshift/origin-server/blob/721854dbe2fd45e4fbeeb93a0872b8b03648224c/broker/openshift-origin-broker.spec#L240-L250 However, they're also created and owned by the spec: https://github.com/openshift/origin-server/blob/721854dbe2fd45e4fbeeb93a0872b8b03648224c/broker/openshift-origin-broker.spec#L153-L157 https://github.com/openshift/origin-server/blob/721854dbe2fd45e4fbeeb93a0872b8b03648224c/broker/openshift-origin-broker.spec#L199 I think all we have to do is... not do those touches. Do we even need to make them %ghost? That just makes them disappear when the RPM is uninstalled.
The %post snipped is needed to ensure that the log files actually exist before anyone runs one of the admin tools. Labeling the files %ghost probably wasn't needed and I see it has since been removed. Originally the files were listed in the spec just like the code and on upgrade they were overwritten. I added the %ghost tag and the %post snippet. The git commit history doesn't say exactly why %ghost was removed but I suspect it was so that the logs would stick around after RPM removal. That github issue was really old and filing this bug was mostly a reminder to verify that the current state is actually working as expected.
To be clear, removing %ghost works because the file entries were removed entirely.
Just going to verify this actually is not a problem any more, or fix if it is.
Updating the broker still seems to be blowing these log files away. Will have to figure out why that is.
https://github.com/openshift/origin-server/pull/6025
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/158523318acd8c3b38044757d377ec96720ae249 Revert "we do not want %ghost-ed log files" This reverts commit 0550ff74df3acb60f391dcd4b1f297ae881b36ea. We do in fact want the log files to be %ghost so they are not overwritten on every update. Bug 1134578 - The Broker's user_action.log should not be overwritten on RPM upgrade https://bugzilla.redhat.com/show_bug.cgi?id=1134578
Check on puddle [2.2.4/2015.01.23.2] 1.write 'xiama' in the log file #echo xiama >>/var/log/openshift/broker/development.log #echo xiama >>/var/log/openshift/broker/development.log #echo xiama >>/var/log/openshift/broker/user_action.log #echo xiama >>/var/log/openshift/broker/usage.log 2. update the openshift-origin-broker to '1.16.2.2-1.el6op'version 3. check the log file all log file is rewrote. 4.write 'xiama' in the log file #echo xiama >>/var/log/openshift/broker/development.log #echo xiama >>/var/log/openshift/broker/development.log #echo xiama >>/var/log/openshift/broker/user_action.log #echo xiama >>/var/log/openshift/broker/usage.log 5. update the openshift-origin-broker to '1.16.2.3-1.el6op'version 6. check the log file #grep xiama /var/log/openshift/broker/* /var/log/openshift/broker/development.log:xiama /var/log/openshift/broker/production.log:xiama /var/log/openshift/broker/usage.log:xiama /var/log/openshift/broker/user_action.log:xiama Can not reproduce this issue on node and console log
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0220.html