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):
# rpm -q debugmode
# rpm -ql debugmode
# cat /etc/profile.d/debug.sh
if [ -f /etc/sysconfig/debug ]; then
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
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.
The idea is that the user could configure the variables if they wanted to (and only enable some of them, etc.)