Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 590063 - /etc/sysconfig/debug should contain a boolean, not the actual implementation
/etc/sysconfig/debug should contain a boolean, not the actual implementation
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-07 11:53 EDT by Matt McCutchen
Modified: 2014-03-16 23:23 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-13 16:27:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt McCutchen 2010-05-07 11:53:15 EDT
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 12:13:04 EDT
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 06:49:07 EDT
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 16:27:25 EDT
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.