Bug 888671
| Summary: | [Installation]oo-accept-broker or oo-accept-systems will create production.log, the file's permission is wrong. | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | xjia <xjia> |
| Component: | Node | Assignee: | Brenton Leanhardt <bleanhar> |
| Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 1.2.0 | CC: | bleanhar, jialiu, libra-onpremise-devel, xtian, zsun |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-01-31 20:33:44 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
xjia
2012-12-19 07:50:19 UTC
Great catch. This was actually due to a fairly recent change where I marked the log files as %ghost because that was technically more correct from an RPM standpoint. Since those script actually run the rails environment we do need to be more protective. I'll revert back to having the broker RPM create the files and setup the correct ownership. Upstream pull request: https://github.com/openshift/origin-server/pull/1089 After looking at the code I remember why %ghost was added. We wanted to avoid log files from being overwritten on RPM upgrade. The latest upstream pull requests is here: https://github.com/openshift/origin-server/pull/1096 This will ship with the next 1.1 puddle. Retest this bug with 1.1.x/2013-01-02.1 puddle, and FAIL. 1. After install broker package, the log files are not generated. # ll /var/www/openshift/broker/log/production.log ls: cannot access /var/www/openshift/broker/log/production.log: No such file or directory 2. run "oo-accept-systems" and "oo-accept-broker" to check the log file's permission. # ll /var/www/openshift/broker/log/production.log -rw-r--r--. 1 root root 0 Jan 3 22:32 /var/www/openshift/broker/log/production.log Oops, it is my fault, in comment 6, I used an old puddle to test this bug, so pls ignore comment 6. I will verify this bug soon. Verified this bug with 1.1.x/2013-01-02.1 puddle, and PASS.
# rpm -q --scripts openshift-origin-broker-1.0.7-1.el6op.noarch
postinstall scriptlet (using /bin/sh):
# We are forced to create these log files if they don't exist because we have
# command line tools that will load the Rails environment and create the logs
# as root. We need the files labeled %ghost because we don't want these log
# files overwritten on RPM upgrade.
for l in /var/log/openshift/user_action.log /var/www/openshift/broker/log/{development,production}.log; do
if [ ! -f $l ]; then
touch $l
fi
chown apache:apache $l
chmod 640 $l
done
<--snip-->
After install broker package, the log files are generated with correct permission.
[root@broker ~]# ll /var/log/openshift/user_action.log
-rw-r-----. 1 apache apache 306756 Jan 4 02:09 /var/log/openshift/user_action.log
[root@broker ~]# ll /var/www/openshift/broker/log/production.log
-rw-r-----. 1 apache apache 549818 Jan 4 02:10 /var/www/openshift/broker/log/production.log
Run "oo-accept-systems" and "oo-accept-broker" to check the log file's permission, they are still correct.
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. http://rhn.redhat.com/errata/RHSA-2013-0220.html |