This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 988756 - Add Requires: bc to jbosseap and jbossews spec file
Add Requires: bc to jbosseap and jbossews spec file
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
1.2.0
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-26 06:05 EDT by Jim Minter
Modified: 2017-03-08 12 EST (History)
6 users (show)

See Also:
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 10:41:03 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jim Minter 2013-07-26 06:05:13 EDT
We installed the jbosseap and jbossews cartridges on a cut-down customer RHEL install which didn't include the bc RPM by default.  In each cartridge, bc is used at various points to calculate the Java max_heap and other parameters.  If the bc RPM isn't present, the cartridges won't start.  The cartridges should each declare a Requires: dependency on bc in their RPM spec files, or their logic should be cleaned up to remove the requirements for bc to be present.
Comment 2 Miciah Dashiel Butler Masters 2013-07-26 11:46:56 EDT
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.)
Comment 3 Jim Minter 2013-07-26 11:56:23 EDT
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...
Comment 4 Brenton Leanhardt 2013-11-15 16:59:06 EST
Looks like this was fixed for jbosseap upstream by not for ews.  We'll fix this in an errata release.
Comment 5 Brenton Leanhardt 2014-01-23 14:03:34 EST
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
Comment 7 openshift-github-bot 2014-01-23 17:33:17 EST
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
Comment 10 Gaoyun Pei 2014-01-25 20:37:31 EST
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
Comment 12 errata-xmlrpc 2014-02-25 10:41:03 EST
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

Note You need to log in before you can comment on or make changes to this bug.