svn commit: r196870 - stable/7/etc/rc.d
Craig Rodrigues
rodrigc at FreeBSD.org
Sat Sep 5 18:44:36 UTC 2009
Author: rodrigc
Date: Sat Sep 5 18:44:36 2009
New Revision: 196870
URL: http://svn.freebsd.org/changeset/base/196870
Log:
This set of MFC's brings savecore closer to the trunk version.
Now, crashinfo will only be run if the following conditions are true:
- savecore -C determines that a crash dump exists
- crashinfo_enable="YES"
MFC: 182460
Add the ability to run /usr/sbin/crashinfo on a new core dump automatically
during boot.
MFC: 180318
Remove the $DUMPDIR variable. It's redundant and the rest of the
script uses $dumpdir directly.
MFC: 180317
Make checking for the availability of core dumps work in the case
that $dumpdev is not set to "AUTO".
Modified:
stable/7/etc/rc.d/savecore
Modified: stable/7/etc/rc.d/savecore
==============================================================================
--- stable/7/etc/rc.d/savecore Sat Sep 5 17:40:27 2009 (r196869)
+++ stable/7/etc/rc.d/savecore Sat Sep 5 18:44:36 2009 (r196870)
@@ -52,10 +52,25 @@ savecore_prestart()
savecore_start()
{
+ local dev
+
+ case "${dumpdev}" in
+ [Aa][Uu][Tt][Oo])
+ dev=
+ ;;
+ *)
+ dev="${dumpdev}"
+ ;;
+ esac
+
echo "Checking for core dump on ${dumpdev}..."
- savecore ${savecore_flags} ${dumpdir} ${dumpdev}
- if checkyesno crashinfo_enable; then
- ${crashinfo_program} -d ${dumpdir}
+ if savecore -C "${dumpdir}" "${dev}" >/dev/null; then
+ savecore ${savecore_flags} ${dumpdir} ${dumpdev}
+ if checkyesno crashinfo_enable; then
+ ${crashinfo_program} -d ${dumpdir}
+ fi
+ else
+ [ -z "${rc_quiet}" ] && echo "No core dumps found"
fi
}
More information about the svn-src-stable-7
mailing list