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.
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