Bug 577875 - Agent wrapper messes up term window in linux
Summary: Agent wrapper messes up term window in linux
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 1.4
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon-sprint9-bugs
TreeView+ depends on / blocked
 
Reported: 2010-03-29 14:54 UTC by Corey Welton
Modified: 2010-08-12 16:58 UTC (History)
1 user (show)

Fixed In Version: 2.4
Clone Of:
Environment:
Last Closed: 2010-08-12 16:58:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Corey Welton 2010-03-29 14:54:34 UTC
Description of problem:

After launching the agent wrapper, and subsequent exit, the user may find his terminal a bit messed up - hitting the Enter key no longer provides a CRLF. 

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

How reproducible:
Every time

Steps to Reproduce:
1.  Launch rhq-agent-wrapper.sh on a linux system - not sure if this requires a linux terminal program at this point, too.
2.  After it exits, hit your enter key a few times
3.  View results.
  
Actual results:

[root@rlx-0-12 ~]# rhq-agent/bin/rhq-agent-wrapper.sh start
Starting RHQ Agent...
RHQ Agent (pid 2888) is running
[root@rlx-0-12 ~]# [root@rlx-0-12 ~]# [root@rlx-0-12 ~]# 

Expected results:
User should be able to hit enter and get correct CRLFs.

Additional info: 

This is a recent development that I have seen over the last few weeks/months but I was never able to definitively determine what was causing it.

Comment 1 Corey Welton 2010-03-29 15:08:56 UTC
(i.e., this is a regression.)

Comment 2 John Sanda 2010-04-22 13:53:57 UTC
Corey, on what OS and version did you see this behavior? I was able to reproduce it on F12 but did not reproduce it on Mac OS X. I will try and see if I can test on some other platforms as well.

Comment 3 Corey Welton 2010-04-22 14:07:58 UTC
I was on F12; i saw it occur ssh'ed into a linux and a solaris system.  Wonder if it could be an issue with the term program, not the agent?  I'll investigate that too.

Comment 4 Corey Welton 2010-04-22 14:17:07 UTC
Doesn't look to be the fault of my term program.  I have reproduced this using 'terminate', 'terminal' and 'xterm'.

Also note that it doesn't appear to happen with 'stop', only 'start'.  The following output is using 'terminal', ssh'ed into a solaris box.


bash-2.05# bin/rhq-agent-wrapper.sh stop
Stopping RHQ Agent...
RHQ Agent (pid=18942) is stopping...
RHQ Agent has stopped.
bash-2.05# 
bash-2.05# 
bash-2.05# bin/rhq-agent-wrapper.sh start
Starting RHQ Agent...
RHQ Agent (pid 24218) is running
bash-2.05# bash-2.05# bash-2.05#

Comment 5 John Mazzitelli 2010-04-22 14:37:18 UTC
I just replicated this on F11. It only happens if you use "start" (and "restart", which effectively does the "start" code internally). This doesn't happen when using the stop, kill or status options.

Need to check what changed recently in either rhq-agent.sh (which is what "start" option uses) or the wrapper's start code. This definitely did not happen in previous versions so something changed to cause this.

Comment 6 John Mazzitelli 2010-04-22 14:45:41 UTC
I confirmed the problem here is the new jline integration. If you use jline but put the agent in the background, for some reason, jline is eating up the echo'ed characters to the console.

To test:

export RHQ_AGENT_CMDLINE_OPTS="--daemon --console=java"
rhq-agent-wrapper.sh start

You will notice this starts fine. Now stop the agent and try sigar:

rhq-agent-wrapper.sh stop
export RHQ_AGENT_CMDLINE_OPTS="--daemon --console=sigar"
rhq-agent-wrapper.sh start

Again, works fine. Now try jline:

rhq-agent-wrapper.sh stop
export RHQ_AGENT_CMDLINE_OPTS="--daemon --console=jline"
rhq-agent-wrapper.sh start

Now you see the console is screwed up. Need to figure out a way to disable jline when running as a daemon. This should not be difficult to do, just have to find out the proper place to do it (either in AgentMain or in one of the scripts).

Comment 7 John Mazzitelli 2010-04-22 15:07:38 UTC
git commit in master: 6e1b30927baa58b7ee02741731b6f2ffc8e3f26f

Comment 8 Corey Welton 2010-04-27 16:59:14 UTC
QA Verified.

Comment 9 Corey Welton 2010-08-12 16:58:00 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.