Bug 1121826

Summary: [A-MQ]Can't create A-MQ app due to syntax error in control script
Product: OpenShift Container Platform Reporter: xjia <xjia>
Component: FuseAssignee: Kurt T Stam <kurt.stam>
Status: CLOSED CURRENTRELEASE QA Contact: David Simansky <dsimansk>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: aileenc, janstey, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-28 13:54:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description xjia 2014-07-22 02:46:39 UTC
Description of problem:
Create A-MQ app. it shows error message:

/var/lib/openshift/53ce02d33ed95638b400002b/jboss-amq/bin/control: line 86: syntax error near unexpected token `else'
/var/lib/openshift/53ce02d33ed95638b400002b/jboss-amq/bin/control: line 86: `    else'

Check the code, it lacks "then" in /usr/libexec/openshift/cartridges/amq/bin/control#72
 71 function stop() {
 72     if [ -f $AMQ_PID_FILE ];
 73         PID=`cat $AMQ_PID_FILE | grep "item.0.pid" | awk -F " = " '{print $2}'`

Patch:
 71 function stop() {
 72     if [ -f $AMQ_PID_FILE ]; then
 73         PID=`cat $AMQ_PID_FILE | grep "item.0.pid" | awk -F " = " '{print $2}'`

Version-Release number of selected component (if applicable):
devenv_4988
openshift-origin-cartridge-amq-6.1.0.redhat.387-1.el6op.noarch.rpm

Steps to Reproduce:
1. rhc app create amq fusesource-jboss-amq-6.1.0

Actual results:
[root@ip-10-5-170-3 ~]# rhc app create amq fuses
Using fusesource-jboss-amq-6.1.0 (JBoss AMQ 6.1.0 EA) for 'fuses'

Application Options
-------------------
Domain:     fuse
Cartridges: fusesource-jboss-amq-6.1.0
Gear Size:  default
Scaling:    no

Creating application 'amq' ... 
Failed to execute: 'control start' for /var/lib/openshift/53ce02d33ed95638b400002b/jboss-amq
/var/lib/openshift/53ce02d33ed95638b400002b/jboss-amq/bin/control: line 86: syntax error near unexpected token `else'
/var/lib/openshift/53ce02d33ed95638b400002b/jboss-amq/bin/control: line 86: `    else'


Expected results:
Success

Comment 3 xjia 2014-07-22 05:31:31 UTC
for the new version:openshift-origin-cartridge-amq-6.1.0.redhat.387-3.el6op.noarch.rpm, this bug is fixed.

Could you move this bug "ON_QA"? Thanks.

Comment 4 Aileen 2014-07-22 12:07:45 UTC
Is this the one you already fixed yesterday?

Comment 5 Jonathan Anstey 2014-07-22 12:29:41 UTC
Yeah, this will be fixed in the next RPM build.

Comment 6 xjia 2014-07-28 11:43:21 UTC
Version:
openshift-origin-cartridge-amq-6.1.0.redhat.387-4.el6op.noarch.rpm

Verify:
[root@broker ~]# rhc app create amq1 jboss-amq
Using jboss-amq-6.1.0 (JBoss AMQ 6.1.0 EA) for 'jboss-amq'

Application Options
-------------------
Domain:     jia
Cartridges: jboss-amq-6.1.0
Gear Size:  default
Scaling:    no

Creating application 'amq1' ... done

  Setting up JBoss AMQ
Generating password
AMQ created successfully.  Please make note of these credentials:

   Console URL:        http://amq1-jia.fuse.com
   Console User:       admin
   Console Password:   hngnTb4PVfsc

SSL self signed certificate: 
-----BEGIN CERTIFICATE-----
MIIE1zCCAr+gAwIBAgIERGTwEjANBgkqhkiG9w0BAQsFADAcMRowGAYDVQQDExFhbXExLWppYS5m
dXNlLmNvbTAeFw0xNDA3MjgxMDUyMDZaFw0yNDA3MjUxMDUyMDZaMBwxGjAYBgNVBAMTEWFtcTEt
amlhLmZ1c2UuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAwrmKLvaFO02iU06R
ZlAWoVg+ftlI/yorcjHmzaDnrfHCzCFyZmRXKDjEcPzyQV/+shAlsHMAvhDxQ2oWa772hl2u5V34
9UnbPX4LTOEHuSbBHa7+W0Ixtp6+eggq3g0or+Q8OTdlYQYKjQh6V5vchQZkhFij44hA2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JydwDjHKrLI
1Q4us98HnDqRS8RbcvnWemzijdTA1xqa+u89nyk46G0p1xfI8O93AryUEdEKSdBl6+0MwiKjyzd/
npK1HgepXqN2HPAyFIxBDoqUEjvFv90sU5oi9nH5AvAflriVaFcN/sp+zLPIB0dPl+71QWj0Dwty
Ws3GwShyahzkytczJio545jPiYBj0SHNueZrvhPie5sSKuptF5LbxwDg9/HlTA==
-----END CERTIFICATE-----
JBoss AMQ( 21530) is started successfully
Started JBoss AMQ cart

Waiting for your DNS name to be available ... done