Bug 534463 (RHQ-1257) - RHQ_AGENT_DEBUG / RHQ_SERVER_DEBUG should allow for "false" value
Summary: RHQ_AGENT_DEBUG / RHQ_SERVER_DEBUG should allow for "false" value
Keywords:
Status: CLOSED NEXTRELEASE
Alias: RHQ-1257
Product: RHQ Project
Classification: Other
Component: Launch Scripts
Version: unspecified
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Corey Welton
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-13 01:12 UTC by John Mazzitelli
Modified: 2009-01-05 15:13 UTC (History)
0 users

Fixed In Version: 1.2
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2008-12-13 01:12:00 UTC
This has always bugged me. RHQ_AGENT_DEBUG and RHQ_SERVER_DEBUG today can be any value - as long as its set to something, debug is enabled. To turn debug off, that env var must not be set at all. So, "RHQ_AGENT_DEBUG=false" actually turned on debug mode because as long as that variable is set to something, debug mode is turned on.

This causes some issues with maintaining the env scripts and the running environment of the agent and server, especially when you want that variable set all the time. I want to be able to always have that env var set - and its value determines whether or not debug mode is on.

To maintain backwards compatibility, I will still allow this var to have any value to enable debug mode - however, the value of "false" is to be the exception now. If you set this value to "false", debug mode will not be turned on. So, these turn debug mode on:

RHQ_AGENT_DEBUG=1
RHQ_AGENT_DEBUG=true
RHQ_AGENT_DEBUG=foo

These turn debug mode off:

unset RHQ_AGENT_DEBUG
RHQ_AGENT_DEBUG=false

The above holds true for the RHQ_SERVER_DEBUG variable too.


Comment 1 John Mazzitelli 2008-12-13 01:23:13 UTC
I had rhq-server.sh and rhq-agent-wrapper.sh reverse the meaning of the debug var. fixed in 2350.

Comment 2 Corey Welton 2008-12-23 21:51:55 UTC
'1' will turn debug on, but '0' won't turn it off?  

I think I understand the purpose of using nearly any $value for RHQ_AGENT_DEBUG, but if we're going to implicitly allow '1', should '0' mean the opposite?

Otherwise, these appear to work correctly..


Comment 3 Corey Welton 2009-01-05 15:06:39 UTC
QA Verified.

Comment 4 John Mazzitelli 2009-01-05 15:13:22 UTC
Trying to keep it as backward compatible as possible.

Before, setting this to "1" had no special meaning. That's because before, if the value was ANYTHING, debug was enabled. "1" was the same as "0" which was the same as "foo".  As long as the variable was set, debug was enabled.

Now, almost the same thing is still true.  Setting the variable to "1" is the same as setting it to "true" is the same as setting it to "0" is the same as setting it to "foo" (this is backward compatible to the old script).  

The only difference now is if the value is "false", that explicitly does not turn on debug.

So, the only way this breaks backward compatibility is if a user previously did this to enable debug mode:

export RHQ_AGENT_DEBUG=false

But I doubt anyone was doing that to actually turn on debug mode :)

Comment 5 Red Hat Bugzilla 2009-11-10 20:29:11 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1257



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