Description of problem: Installed JON 3,3 ER05 build on solaris 10 using Bourne Shell with rhqctl install. When tried to start with rhqctl start, at the last stage, it shows below error: Starting RHQ Agent... ERROR! Cannot find the RHQ Agent start script Not found: ./bin/rhq-agent.sh ----------- JON is installed at: /export/home/JON3.3ER05/jon-server-3.3.0.ER05 rhq-agent is at : /export/home/JON3.3ER05/rhq-agent Also checked that rhq-agent.sh exists at /export/home/JON3.3ER05/rhq-agent/bin Version-Release number of selected component (if applicable): JON 3,3 ER05 How reproducible: Always Steps to Reproduce: 1. On solaris 10, do ./rhqctl install 2. then ./rhqctl start 3. At the end, it shows the error: ERROR! Cannot find the RHQ Agent start script Not found: ./bin/rhq-agent.sh Actual results: rhqctl start shows error and could not find the RHQ Agent start script. RHQ Agent does not start. Expected results: rhqctl start works and agent starts successfully Additional info:
i think this works. in rhq-agent-wrapper.sh, in the if-stmt for when there is no readlink: _WORKINGPATH="`dirname \"$0\"`" _WORKINGPATH="`(cd \"$_WORKINGPATH\" && pwd )`" _DOLLARZERO="$_WORKINGPATH"/rhq-agent-wrapper.sh
MASTER: commit 029ef29dc2f25dc34b899058ea8bb06588e4d5da Author: John Mazzitelli <mazz> Date: Thu Oct 30 12:29:50 2014 -0400 BZ 1158948 - make sure agent can start/stop via rhqctl on solaris 10 3.3 BRANCH: commit dfbe1e04fd55bb12bf050128b0c9fe9288c53714 Author: John Mazzitelli <mazz> Date: Thu Oct 30 12:29:50 2014 -0400 BZ 1158948 - make sure agent can start/stop via rhqctl on solaris 10 (cherry picked from commit 029ef29dc2f25dc34b899058ea8bb06588e4d5da)
Moving to ON_QA as available for test with build: https://brewweb.devel.redhat.com//buildinfo?buildID=398756
Tested on version : 3.3.0.GA Build Number : f8f6447:6a2b52e Solaris version: SunOS solaris10 5.10 Generic_147148-26 i86pc i386 i86pc Shell: /bin/sh ------------------------------------------------- On solaris 10, installed JBoss ON with rhqctl install, when executing rhqctl start, it shows syntax error as below: INFO 19:10:02,736 Startup completed! Now serving reads. WARNING: The readlink command is not available on this platform. If this script was launched from a symbolic link, errors may occur. Consider installing readlink on this platform. Trying to start the RHQ Server... RHQ Server (pid 3161 ) is starting ./rhq-agent-wrapper.sh: syntax error at line 155: `_DOLLARZERO=$' unexpected -------
The problem was introduced by $() syntax that isn't valid on Solaris. We need to change this: elif [ -n "${_DARWIN}" ]; then _DOLLARZERO=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)/`basename "${BASH_SOURCE[0]}"` to something like: elif [ -n "${_DARWIN}" ]; then __tmp_dirname=`dirname "${BASH_SOURCE[0]}"` __tmp_basename=`basename "${BASH_SOURCE[0]}"` _DOLLARZERO=`cd "${__tmp_dirname}" && pwd`/${__tmp_basename} This fix for Mac was put in a few places, we probably have to fix this in all the places where the $() syntax was added. WORKAROUND: Those on Solaris should just delete or comment out line 155 of rhq-agent-wrapper.sh. That should fix it. Those lines aren't executed on Sol 10 anyway. They are for Mac.
there are three files that were changed in commit 04fd1353f62fc38839d82e229de8485a08b048cc that need to be fixed with my above suggestion (or something similar) rhq-agent.sh rhq-agent-wrapper.sh standalone-pc.sh
line 96 has to be deleted from rhq-agent.sh as well for things to work on sol 10
(In reply to John Mazzitelli from comment #9) > line 96 has to be deleted from rhq-agent.sh as well for things to work on > sol 10 and of course that isn't fully correct - you need to have some statement in there. so just replace line 96 with something like "echo"
Not sure how we can safely use ${BASH_SOURCE[0]} either. The reason $() is failing is because Solaris does not use BASH. The environment variable BASH_SOURCE and the introduction of arrays is only available in BASH. Solaris does not use BASH by default. Instead it uses Bourne Shell (SH).
(In reply to Larry O'Leary from comment #12) > Not sure how we can safely use ${BASH_SOURCE[0]} either. The reason $() is > failing is because Solaris does not use BASH. The environment variable > BASH_SOURCE and the introduction of arrays is only available in BASH. > Solaris does not use BASH by default. Instead it uses Bourne Shell (SH). Those lines aren't even used on Sol 10 so it doesn't matter - we could completely delete them and it will be the same (which, in fact, is my proposed workaround). Those lines with BASH_SOURCE are only ever executed on Mac/OS. We just need to get rid of $() since Sol 10 sh is parsing those lines even though it doesn't execute them and barfing.
(In reply to Larry O'Leary from comment #12) > and the introduction of arrays is only available in BASH. That is something - lemme try that. Didn't think about array syntax.
(In reply to John Mazzitelli from comment #14) > (In reply to Larry O'Leary from comment #12) > > and the introduction of arrays is only available in BASH. > > That is something - lemme try that. Didn't think about array syntax. Just tried this on Sol 10 and it worked OK. I think array syntax is fine: in rhq-agent.sh, I replaced line 96 with the following (I also did the same in line 155 of rhq-agent-wrapper.sh): _DOLLARZERO=${BASH_SOURCE[0]} So the proposed workarounds and proposed fixes should work.
Fixed the above three scripts and rhq-cli.sh using the above technique in #c7 commit 5180f0539b678d1c89ed848844dfdd85e423d379 Author: Mike Thompson <mithomps> Date: Mon Nov 17 09:20:58 2014 -0800 [BZ 1158948] rhqctl start on solaris 10 shows error- Cannot find the RHQ Agent start script. Provide an alternative on OS/X for $() syntax as solaris doesnt like it even if it
Cherry picked to release/3.3.x branch: commit 60e775706faf1c8eec007517667eb35af4fd2a29 Author: Mike Thompson <mithomps> Date: Mon Nov 17 09:20:58 2014 -0800 [BZ 1158948] rhqctl start on solaris 10 shows error- Cannot find the RHQ Agent start script. Provide an alternative on OS/X for $() syntax as solaris d (cherry picked from commit 5180f0539b678d1c89ed848844dfdd85e423d379) Signed-off-by: John Mazzitelli <mazz>
if we respin 3.3 and this fix gets in, we can remove the doc flag - no workaround will be needed.
3.3 is getting re-spun. Based on this fact, I'm removing the requires_doc_text flag as the issue no longer requires documenting per Comment 20.
Moving to ON_QA as available to test with latest brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=399113
Verified on Version : 3.3.0.GA Build Number : 4f16df3:e347f77 Verified below on solaris 10 using Bourne Shell: rhqctl install , rhqctl start works without error. discovery, import works. Agent and server are green. CLI login and getting storage node list using cli works.