From 1c27e9e64ba2bec2868da849e86b227b56f03257 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 29 Jul 2008 12:09:51 -0400 Subject: Rename the mcheck stuff to a more generic 'debug' framework. --- Makefile | 4 ++-- debug.csh | 3 +++ debug.sh | 4 ++++ initscripts.spec | 2 +- mcheck.csh | 4 ---- mcheck.sh | 7 ------- sysconfig/debug | 13 +++++++++++++ sysconfig/mcheck | 9 --------- 8 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 debug.csh create mode 100644 debug.sh delete mode 100644 mcheck.csh delete mode 100644 mcheck.sh create mode 100644 sysconfig/debug delete mode 100644 sysconfig/mcheck 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/debug b/sysconfig/debug new file mode 100644 index 00000000..f0c05aae --- /dev/null +++ b/sysconfig/debug @@ -0,0 +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 +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 diff --git a/sysconfig/mcheck b/sysconfig/mcheck deleted file mode 100644 index 94f35bd7..00000000 --- a/sysconfig/mcheck +++ /dev/null @@ -1,9 +0,0 @@ - -# 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 - -- cgit v1.2.1