Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1099781

Summary: Tomcat7 daemon.sh did not start
Product: [JBoss] JBoss Enterprise Web Server 2 Reporter: Libor Fuka <lfuka>
Component: tomcat7Assignee: Jean-frederic Clere <jclere>
Status: CLOSED EOL QA Contact: Libor Fuka <lfuka>
Severity: high Docs Contact:
Priority: high    
Version: 2.1.0CC: jdoyle, mturk, pslavice, rsvoboda, weli
Target Milestone: ER04   
Target Release: 2.1.0   
Hardware: All   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously in JBoss Enterprise Web Server the Tomcat7 <filename>daemon.sh</filename> file did not start as expected on Oracle Solaris. When <filename>/opt/jboss-ews-2.1/share/tomcat7/bin/daemon.sh</filename> is run under the <literal>tomcat</literal> user on Solaris, the following error is displayed: <screen>/opt/jboss-ews-2.1/share/tomcat7/bin/daemon.sh: test: argument expected</screen> This issue is fixed in JBoss Enterprise Web Server 2.1.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-13 08:15:06 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 Libor Fuka 2014-05-21 07:50:04 UTC
Description of problem:
When i run /opt/jboss-ews-2.1/share/tomcat7/bin/daemon.sh start under tomcat user i got an error: /opt/jboss-ews-2.1/share/tomcat7/bin/daemon.sh: test: argument expected

It happens on all Solaris platforms

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
Tomcat7 daemon.sh should start

Additional info:

Comment 1 Libor Fuka 2014-06-27 11:23:18 UTC
There are missing quotes "" in if on lines 108 and 110.

It should be:
if [ -z "$JSVC" ]; then
    JSVC="$CATALINA_BASE/bin/jsvc"
    if [ ! -x "$JSVC" ]; then
        JSVC="$CATALINA_HOME/bin/jsvc"
    fi
fi

Solaris has problem without quotes.

Comment 2 Libor Fuka 2014-06-27 11:24:15 UTC
tomcat7 daemon.sh script

Comment 3 Mladen Turk 2014-06-30 11:27:25 UTC
Here is the peace of code that can fix this issue

perl -pi -e 's; \$JSVC \]; "\$JSVC" \];g' daemon.sh

Comment 4 Mladen Turk 2014-06-30 13:27:47 UTC
OK. I have applied the patch to Solaris build.
So you can treat this issue as resolved by ER4.

However ...
It would be nice to have that upstream, so I'll commit the patch to Tomcat directly. Can somone create upstream BZ issue so I can have a reference inside
Tomcat 7.0.x svn?

Libor, can you file that upstream?

Comment 5 Libor Fuka 2014-06-30 13:30:59 UTC
I will file the bug upstream.

Comment 6 Libor Fuka 2014-06-30 13:36:46 UTC
Tomcat upstream bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=56685

Comment 7 Mladen Turk 2014-06-30 13:46:55 UTC
Great, thanks Libor.

Note that Solaris has more "strict" shell rules and as such the same issue is not visible under Linux bash. However the good practice is to quote probably empty variables. So far we will have the patch for Solaris builds only, and once this gets fixed upstream and we rebase, I'll remove this patch from Solaris builds.

Comment 8 Libor Fuka 2014-07-18 14:57:28 UTC
VERIFIED with EWS 2.1.0-ER4