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
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts   
(Show other bugs)
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
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:
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: ---


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


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