Bug 988756
| Summary: | Add Requires: bc to jbosseap and jbossews spec file | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Jim Minter <jminter> |
| Component: | Containers | Assignee: | Brenton Leanhardt <bleanhar> |
| Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 1.2.0 | CC: | adellape, gpei, jolamb, libra-onpremise-devel, mmasters, pruan |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | openshift-origin-cartridge-jbossews-1.17.2.2-1.el6op | Doc Type: | Bug Fix |
| Doc Text: |
Previously, cartridge scripts that depend on the bc package for calculating various JVM parameters failed due to a missing requirement in the JBoss EAP and JBoss EWS packages. This bug fix adds the bc package requirement to the cartridges, and these failures no long occur.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-02-25 15:41:03 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
Jim Minter
2013-07-26 10:05:13 UTC
On the one hand, it would be easy to rewrite the calculations not to use bc. The calculations all appear to be of the form
echo $x * $y | bc | awk '{print int($1+0.5)}
where we use bc for multiplication and awk for rounding; it would be an easy change to use awk for both multiplication and rounding:
echo $x $y | awk '{print int(($1*$2)+0.5)}'
On the other hand, the least invasive change would be to add 'Requires: bc' to the spec files for jbosseap and jbossews. In fact, jbossas already has exactly the same calculations as the jbosseap and jbossews cartridges currently do, and jbossas has the 'Requires: bc' line in its spec file.
(Sidenote: If the numerator $y were a percentage—e.g., if we had y=33 instead of y=0.33—it would be possible to do the calculation entirely from shell using expr:
expr \( $x \* $y + 50 \) / 100
expr just doesn't do non-integers.)
integer_arithmetic++ RESULT=$(( (x * y + 50) / 100 )) is even better than the expr example because then you don't need to clone/execve to run expr. The number of clones/execves required by OpenShift and its scripts is astonishing... Looks like this was fixed for jbosseap upstream by not for ews. We'll fix this in an errata release. Bug #999603 addressed this upstream for EAP (and in the 2.0 rebase) but the EWS cartridge was still missed. upstream PR: https://github.com/openshift/origin-server/pull/4576 Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/ef306be570f24740a519720520f6618deff0ba0e Bug 988756 - Adding Requires: bc to jbossews cartridge Verify this on openshift-origin-cartridge-jbossews-1.17.2.2-1.el6op.noarch. [root@broker ~]# yum deplist openshift-origin-cartridge-jbossews-1.17.2.2-1.el6op.noarch |grep bc This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. dependency: bc provider: bc.x86_64 1.06.95-1.el6 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/RHBA-2014-0209.html |