Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 590063 - /etc/sysconfig/debug should contain a boolean, not the actual implementation
Summary: /etc/sysconfig/debug should contain a boolean, not the actual implementation
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 12
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-07 15:53 UTC by Matt McCutchen
Modified: 2014-03-17 03:23 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-05-13 20:27:25 UTC
Type: ---

Attachments (Terms of Use)

Description Matt McCutchen 2010-05-07 15:53:15 UTC
Description of problem:
In the current design of the debugmode package, /etc/sysconfig/debug directly sets the environment variables that enable debugging (MALLOC_CHECK_, MALLOC_PERTURB_, G_SLICE).  This design looked convenient until I realized the variables weren't getting exported (bug 589378).

A better design that would be more in the spirit of a sysconfig file would be to simply set a non-exported boolean variable and have /etc/profile.d/debug.sh take care of the implementation details.  That way, future versions of debugmode could add new debugging variables without causing merge conflicts on /etc/sysconfig/debug.

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

Comment 1 Petr Lautrbach 2010-05-07 16:13:04 UTC
Current status:

# rpm -q debugmode

# rpm -ql debugmode

# cat /etc/profile.d/debug.sh

if [ -f /etc/sysconfig/debug ]; then
    . /etc/sysconfig/debug

Fix proposed in #589378 changes /etc/profile.d/debug.sh:
-    . /etc/sysconfig/debug
+    eval `sed '/^[:blank:]*\(#.*\)\?$/d;s/\(.*\)/export \1;/' /etc/sysconfig/debug`

so instead of setting non-exported variables from /etc/sysconfig/debug, /etc/sysconfig/debug is parsed and something like this is run:

++ eval export 'MALLOC_CHECK_=1;' export 'MALLOC_PERTURB_=$(($RANDOM' % 255 + '1));' export 'G_SLICE=debug-blocks;'

/etc/profile.d/debug.csh does it in similar way

Comment 2 Petr Lautrbach 2010-05-10 10:49:07 UTC
As I wrote in the comment #1, the current status is the same as you proposed only that it doesn't export variables and it's being worked in bug 589378.

If you have no other comments I would close this.

Comment 3 Bill Nottingham 2010-05-13 20:27:25 UTC
The idea is that the user could configure the variables if they wanted to (and only enable some of them, etc.)

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