Bug 534463 - (RHQ-1257) RHQ_AGENT_DEBUG / RHQ_SERVER_DEBUG should allow for "false" value
RHQ_AGENT_DEBUG / RHQ_SERVER_DEBUG should allow for "false" value
Product: RHQ Project
Classification: Other
Component: Launch Scripts (Show other bugs)
All All
low Severity medium (vote)
: ---
: ---
Assigned To: John Mazzitelli
Corey Welton
: Improvement
Depends On:
  Show dependency treegraph
Reported: 2008-12-12 20:12 EST by John Mazzitelli
Modified: 2009-01-05 10:13 EST (History)
0 users

See Also:
Fixed In Version: 1.2
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Mazzitelli 2008-12-12 20:12:00 EST
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:


These turn debug mode off:


The above holds true for the RHQ_SERVER_DEBUG variable too.
Comment 1 John Mazzitelli 2008-12-12 20:23:13 EST
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 16:51:55 EST
'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 10:06:39 EST
QA Verified.
Comment 4 John Mazzitelli 2009-01-05 10:13:22 EST
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 15:29:11 EST
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.