Bug 1044986
Summary: | rhqctl script hangs when starting the agent in DEBUG mode | ||
---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | bkramer <bkramer> |
Component: | Launch Scripts, Agent | Assignee: | John Mazzitelli <mazz> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jan Bednarik <jbednari> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | JON 3.2 | CC: | hrupp, jbednari, loleary, mazz, mfoley, miburman, mkoci, myarboro, spinder |
Target Milestone: | CR01 | Keywords: | Triaged, Upstream |
Target Release: | JON 3.2.3 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-09-05 15:40:45 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: | |||
Bug Depends On: | 1044989 | ||
Bug Blocks: |
Description
bkramer
2013-12-19 11:37:36 UTC
This is due to the fact that when debug is enabled, we do not redirect stdout/stderr to the log file. This causes stdout of the start command to be lost and not get slurped in by rhqctl (I think this is related to the fact that we can't pass stdout/stderr/stdin file descriptors down to child processes). If I change the "eval" below (in the if clause) so it redirects stdout/stderr to /dev/null, it no longer hangs. It looks like we don't redirect to the log file on purpose, but I'm not sure why. It would seem the logical thing to do would be to redirect the start command always to the log file, but again, not sure if there was a reason we did it like this before. I'll have to check the history to see what else I can find: rhq-agent-wrapper.sh code: # start the agent now! if [ -n "$RHQ_AGENT_DEBUG" ] && [ "$RHQ_AGENT_DEBUG" != "false" ]; then debug_wrapper_msg "Executing agent with command: ${RHQ_AGENT_START_COMMAND}" eval "$RHQ_AGENT_START_COMMAND > /dev/null 2>&1" #<----this redirection fixes the problem else # since the start command may run as non-root user, ensure the old # wrapper (which may be owned by root) is removed wrapper="rhq-agent-wrapper.log" rm -f $RHQ_AGENT_HOME/logs/$wrapper eval "$RHQ_AGENT_START_COMMAND > \"${RHQ_AGENT_HOME}/logs/${wrapper}\" 2>&1" fi git commit to master b3681f2 resetting state, as this was fixed upstream, but not yet added to the branch. cherry picked to release/jon3.2.x branch: commit 3ed1b1001fa18b28add9459b02896a29675daaed Author: John Mazzitelli <mazz> Date: Thu Feb 27 16:38:00 2014 -0500 BZ 1044986 - fix rhqctl script so it doesn't hang when starting the agent in DEBUG mode (cherry picked from commit b3681f22dd3d7d893f57af56a9be6602111e3d7b) Moving to ON_QA as this is available for test in JON 3.2.3 ER01 build: http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/3.2.3.GA/8-14-14/ Moving to ASSIGNED If the DEBUG mode of agent is enabled, the agent fails to start. I think the problem can be found in rhq-agent-wrapper.sh file on line 242: eval "$RHQ_AGENT_START_COMMAND > \"${RHQ_AGENT_HOME}/logs/${wrapper}\" 2>&1" Variable $wrapper is undefined and the path is evaluated as "${RHQ_AGENT_HOME}/logs/" so the script fails when it tries to redirect stdout to a directory. Version: 3.2.0.GA Update 03 Build Number: bca1bc8:e19c43d Cherry-picked a fix to release/jon3.2.x commit 97c4f6e937d67b3bb133dfda21e2c41d88325e1a Author: John Mazzitelli <mazz> Date: Fri Apr 11 10:38:23 2014 -0400 [BZ 1044986] Remove ${wrapper} which does not match anything, to fix debug part (cherry picked from commit b9ce78527e71a7b558b6a1f3ed71fd7d8f9712d8) Conflicts: modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh Moving to ON_QA as ready for testing with the latest brew build: http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/3.2.3.GA/8-26-14/ Moving to VERIFIED. Checked that variable ${wrapper} was removed from rhq-agent-wrapper.sh and tried to start all components using rhqctl start command -> it works and the script returns the prompt as expected. Version:3.2.0.GA Update 03 Build Number:9766504:97c4f6e |