Description of problem: Any operation (start, status,..) of rhq-agent-wrapper.sh is stuck. Version-Release number of selected component (if applicable): JON3.3.10 and JON3.3.9, probably earlier versions too How reproducible: Always Steps to Reproduce: 1. install the agent: java -jar agent.jar --install 2. export RHQ_AGENT_DEBUG=true 3 ./rhq-agent-wrapper.sh status Actual results: execution is stuck with following output: rhq-agent-wrapper.sh: RHQ_AGENT_WRAPPER_BIN_DIR_PATH=/qa/home/fbrychta/rhq-agent/bin rhq-agent-wrapper.sh: Loading environment script: /qa/home/fbrychta/rhq-agent/bin/rhq-agent-env.sh rhq-agent-wrapper.sh: pidfile will be located at /qa/home/fbrychta/rhq-agent/bin/rhq-agent.pid Expected results: Agent is started and execution of rhq-agent-wrapper.sh is finished Additional info: The issue is not visible on Solaris 11 Intel. It might be just env issue specific to used machine. Any hint how to debug deeper will help. uname -a SunOS dev32-01 5.11 11.3 sun4v sparc sun4v cat /etc/release Oracle Solaris 11.3 SPARC Copyright (c) 1983, 2016, Oracle and/or its affiliates. All rights reserved. Assembled 03 August 2016
Adding complete list of processes. JVM is not started.
Created attachment 1390236 [details] list of processes
Added -x to #!/bin/sh -x in rhq-agent-wrapper.sh so it prints all commands. Running ./rhq-agent-wrapper.sh status [fbrychta@dev32-01 ~]$ rhq-agent/bin/rhq-agent-wrapper.sh status + uname + _SOLARIS=true + command -v readlink + 1> /dev/null 2>& 1 + [ 0 -ne 0 ] + [ -n true ] + _READLINK_ARG=-e + readlink -e rhq-agent/bin/rhq-agent-wrapper.sh + 2> /dev/null + _DOLLARZERO=/qa/home/fbrychta/rhq-agent/bin/rhq-agent-wrapper.sh + [ -z '' ] + dirname /qa/home/fbrychta/rhq-agent/bin/rhq-agent-wrapper.sh + RHQ_AGENT_HOME=/qa/home/fbrychta/rhq-agent/bin + dirname /qa/home/fbrychta/rhq-agent/bin + RHQ_AGENT_HOME=/qa/home/fbrychta/rhq-agent + export RHQ_AGENT_HOME + dirname /qa/home/fbrychta/rhq-agent/bin/rhq-agent-wrapper.sh + RHQ_AGENT_WRAPPER_BIN_DIR_PATH=/qa/home/fbrychta/rhq-agent/bin + debug_wrapper_msg RHQ_AGENT_WRAPPER_BIN_DIR_PATH=/qa/home/fbrychta/rhq-agent/bin + [ -n '' ] + [ -f /qa/home/fbrychta/rhq-agent/bin/rhq-agent-env.sh ] + debug_wrapper_msg 'Loading environment script: /qa/home/fbrychta/rhq-agent/bin/rhq-agent-env.sh' + [ -n '' ] + . /qa/home/fbrychta/rhq-agent/bin/rhq-agent-env.sh status + RHQ_AGENT_UMASK=007 + [ -z 007 ] + umask 007 + 1> /dev/null + [ 0 -ne 0 ] + found_daemon_option=0 + [ 0 '=' 0 ] + RHQ_AGENT_CMDLINE_OPTS='--daemon ' + export RHQ_AGENT_CMDLINE_OPTS + cd /qa/home/fbrychta/rhq-agent/bin + pwd + _THIS_SCRIPT_DIR=/qa/home/fbrychta/rhq-agent/bin + basename /qa/home/fbrychta/rhq-agent/bin/rhq-agent-wrapper.sh + _THIS_SCRIPT=/qa/home/fbrychta/rhq-agent/bin/rhq-agent-wrapper.sh + cd /qa/home/fbrychta/rhq-agent + [ ! -d /qa/home/fbrychta/rhq-agent/logs ] + [ -z '' ] + RHQ_AGENT_PIDFILE_DIR=/qa/home/fbrychta/rhq-agent/bin + _PIDFILE=/qa/home/fbrychta/rhq-agent/bin/rhq-agent.pid + debug_wrapper_msg 'pidfile will be located at /qa/home/fbrychta/rhq-agent/bin/rhq-agent.pid' + [ -n '' ] + check_status + [ -f /qa/home/fbrychta/rhq-agent/bin/rhq-agent.pid ] + printf '%-30s (no pid file) is down' 'RHQ Agent' + _STATUS='RHQ Agent (no pid file) is down' + _RUNNING=0 + add_colors + tput colors + 2> /dev/null + _COLORS_NUM=256 + [ 0 '=' 0 ] + [ 256 -gt 2 ] + _COLOR=true + 1> /dev/null 2>& 1 It's stuck on 1> /dev/null 2>& 1
It's not really stuck on that last one, but that one pushes all the output to /dev/null Removing that line might give an indication what the program is trying to say..
Problem is on following line: (sh --version | grep bash) 1> /dev/null 2>&1 'sh --version' is on solaris not printing anything but actually starting new shell I did quick search but I did not find any reliable way how to determine if we are running bash for both solaris and rhel. Following is working fine on rhel: add_colors () { # find out if terminal support colors _COLORS_NUM=`tput colors 2> /dev/null` if [ $? = 0 ] && [ $_COLORS_NUM -gt 2 ]; then _COLOR=true _UP_SYMBOL=`[ ! "X$BASH_VERSION" = "X" ] && echo ✔` _DOWN_SYMBOL=`[ ! "X$BASH_VERSION" = "X" ] && echo ✘` _STATUS=`echo "${_STATUS}" | green running "${_UP_SYMBOL}"` _STATUS=`echo "${_STATUS}" | red down "${_DOWN_SYMBOL}"` fi } and it's not blocking on solaris. Worst case scenario should be that those UP and DOWN symbols are not printed.
Fixed in the master: commit 29a5ccd25661bcb800276303ea6d452a12033dbf (HEAD -> master) Author: Michael Burman <miburman> Date: Tue Mar 20 21:46:26 2018 +0200 [BZ 1540707] Improve sh/bash detection to support Solaris sh also
Moving to ON_QA. Available to test with http://download.eng.bos.redhat.com/brewroot/packages/org.jboss.on-jboss-on-parent/3.3.0.GA/186/maven/org/jboss/on/jon-server-patch/3.3.0.GA/jon-server-patch-3.3.0.GA.zip. * This maps to CR02 build of 3.3.11.
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. https://access.redhat.com/errata/RHSA-2018:2930