aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-07-29 12:09:51 -0400
committerBill Nottingham <notting@redhat.com>2008-07-29 12:09:51 -0400
commit1c27e9e64ba2bec2868da849e86b227b56f03257 (patch)
treeea44fdd5f33cb5769efdd92aad5f10594bbb4803
parent327cfaeab96ffbec4145648de16d58346d4b3f9a (diff)
downloadinitscripts-1c27e9e64ba2bec2868da849e86b227b56f03257.tar
initscripts-1c27e9e64ba2bec2868da849e86b227b56f03257.tar.gz
initscripts-1c27e9e64ba2bec2868da849e86b227b56f03257.tar.bz2
initscripts-1c27e9e64ba2bec2868da849e86b227b56f03257.tar.xz
initscripts-1c27e9e64ba2bec2868da849e86b227b56f03257.zip
Rename the mcheck stuff to a more generic 'debug' framework.
-rw-r--r--Makefile4
-rw-r--r--debug.csh3
-rw-r--r--debug.sh4
-rw-r--r--initscripts.spec2
-rw-r--r--mcheck.csh4
-rw-r--r--mcheck.sh7
-rw-r--r--sysconfig/debug (renamed from sysconfig/mcheck)8
7 files changed, 16 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index d53919d5..b491058f 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ install:
install -m644 rwtab statetab networks $(ROOT)/etc
install -m755 service setsysfont $(ROOT)/sbin
install -m644 lang.csh lang.sh $(ROOT)/etc/profile.d
- install -m644 mcheck.csh mcheck.sh $(ROOT)/etc/profile.d
+ install -m644 debug.csh debug.sh $(ROOT)/etc/profile.d
install -m755 sys-unconfig $(ROOT)/usr/sbin
install -m644 crypttab.5 $(ROOT)$(mandir)/man5
install -m644 service.8 sys-unconfig.8 $(ROOT)$(mandir)/man8
@@ -44,7 +44,7 @@ install:
install -m755 -d $(ROOT)/etc/rc.d $(ROOT)/etc/sysconfig
install -m755 rc.d/rc rc.d/rc.local rc.d/rc.sysinit $(ROOT)/etc/rc.d/
cp -af rc.d/init.d $(ROOT)/etc/rc.d/
- install -m755 sysconfig/mcheck sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/
+ install -m755 sysconfig/debug sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/
cp -af sysconfig/network-scripts $(ROOT)/etc/sysconfig/
cp -af ppp udev NetworkManager event.d $(ROOT)/etc
mkdir -p $(ROOT)/etc/ppp/peers
diff --git a/debug.csh b/debug.csh
new file mode 100644
index 00000000..a5d5df6c
--- /dev/null
+++ b/debug.csh
@@ -0,0 +1,3 @@
+if ( -f /etc/sysconfig/debug ) then
+ eval `egrep -v '(^[:blank:]*#|\$RANDOM)' /etc/sysconfig/debug | sed 's|^export ||g' | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`
+endif
diff --git a/debug.sh b/debug.sh
new file mode 100644
index 00000000..90af7cca
--- /dev/null
+++ b/debug.sh
@@ -0,0 +1,4 @@
+
+if [ -f /etc/sysconfig/debug ]; then
+ . /etc/sysconfig/debug
+fi
diff --git a/initscripts.spec b/initscripts.spec
index a5d5b2f6..48acebb5 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -119,7 +119,7 @@ rm -rf $RPM_BUILD_ROOT
%dir /etc/sysconfig/network-scripts
%config(noreplace) %verify(not md5 mtime size) /etc/adjtime
%config(noreplace) /etc/sysconfig/init
-%config(noreplace) /etc/sysconfig/mcheck
+%config(noreplace) /etc/sysconfig/debug
%config(noreplace) /etc/sysconfig/netconsole
%config(noreplace) /etc/sysconfig/readonly-root
/etc/sysconfig/network-scripts/ifdown
diff --git a/mcheck.csh b/mcheck.csh
deleted file mode 100644
index 94149026..00000000
--- a/mcheck.csh
+++ /dev/null
@@ -1,4 +0,0 @@
-
-if ( -f /etc/sysconfig/mcheck ) then
- setenv MALLOC_CHECK_ = `grep "^MALLOC_CHECK_=" /etc/sysconfig/mcheck | cut -d"=" -f2`
-endif
diff --git a/mcheck.sh b/mcheck.sh
deleted file mode 100644
index 35f076cf..00000000
--- a/mcheck.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-
-if [ -f /etc/sysconfig/mcheck ]; then
- . /etc/sysconfig/mcheck
- if [ -n "$MALLOC_CHECK_" ]; then
- export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
- fi
-fi
diff --git a/sysconfig/mcheck b/sysconfig/debug
index 94f35bd7..f0c05aae 100644
--- a/sysconfig/mcheck
+++ b/sysconfig/debug
@@ -1,9 +1,13 @@
-
# MALLOC_CHECK_: should the system (libc) malloc check for memory errors?
# Used values are:
# unset: do not check
# 0: silently ignore errors
# 1: print diagnostics on stderr when an error is detected
# 2: call abort when an error is detected
-export MALLOC_CHECK_=1
+MALLOC_CHECK_=1
+
+# MALLOC_PERTURB_: initialize cleared memory to the specified value
+MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
+# Perform extra sanity checking in the gslice allocator
+G_SLICE=debug-blocks