Bug 590063

Summary: /etc/sysconfig/debug should contain a boolean, not the actual implementation
Product: [Fedora] Fedora Reporter: Matt McCutchen <matt>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: iarlyy, jonathan, notting, plautrba, rvokal
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-13 20:27:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
initscripts-9.02.2-1

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

# rpm -q debugmode
debugmode-9.02.1-1.x86_64

# rpm -ql debugmode
/etc/profile.d/debug.csh
/etc/profile.d/debug.sh
/etc/sysconfig/debug

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

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


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.)