socsvn commit: r237517 - in soc2012/tzabal/client-side/akcrs-head:
etc/defaults etc/rc.d usr.sbin/crashreport
tzabal at FreeBSD.org
tzabal at FreeBSD.org
Mon Jun 11 22:50:51 UTC 2012
Author: tzabal
Date: Mon Jun 11 22:50:48 2012
New Revision: 237517
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237517
Log:
Client side: Set a unique name for every generated crash report instead of the generic 'report.tar.gz' in order to avoid overwrites in the server. Also, Rename the rc.conf variable 'email' to 'crashreport_email'.
Modified:
soc2012/tzabal/client-side/akcrs-head/etc/defaults/rc.conf
soc2012/tzabal/client-side/akcrs-head/etc/rc.d/savecore
soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh
Modified: soc2012/tzabal/client-side/akcrs-head/etc/defaults/rc.conf
==============================================================================
--- soc2012/tzabal/client-side/akcrs-head/etc/defaults/rc.conf Mon Jun 11 21:56:37 2012 (r237516)
+++ soc2012/tzabal/client-side/akcrs-head/etc/defaults/rc.conf Mon Jun 11 22:50:48 2012 (r237517)
@@ -606,7 +606,7 @@
crashinfo_program="/usr/sbin/crashinfo" # Script to generate crash dump summary.
crashreport_enable="NO" # Automatically report kernel crashes.
crashreport_program="/usr/sbin/crashreport" # Script to send kernel crash report
-email="" # System administrator email address.
+crashreport_email="" # System administrator email address.
quota_enable="NO" # turn on quotas on startup (or NO).
check_quotas="YES" # Check quotas on startup (or NO).
quotaon_flags="-a" # Turn quotas on for all file systems (if enabled)
Modified: soc2012/tzabal/client-side/akcrs-head/etc/rc.d/savecore
==============================================================================
--- soc2012/tzabal/client-side/akcrs-head/etc/rc.d/savecore Mon Jun 11 21:56:37 2012 (r237516)
+++ soc2012/tzabal/client-side/akcrs-head/etc/rc.d/savecore Mon Jun 11 22:50:48 2012 (r237517)
@@ -38,12 +38,12 @@
esac
if [ ! -c "${dumpdev}" ]; then
- warn "Dump device does not exist. Savecore not run."
+ warn "Dump device does not exist. Savecore not run."
return 1
fi
if [ ! -d "${dumpdir}" ]; then
- warn "Dump directory does not exist. Savecore not run."
+ warn "Dump directory does not exist. Savecore not run."
return 1
fi
return 0
@@ -68,7 +68,8 @@
${crashinfo_program} -d ${dumpdir}
fi
if checkyesno crashreport_enable; then
- ${crashreport_program} -d ${dumpdir} -e ${email}
+ ${crashreport_program} -d ${dumpdir} \
+ -e ${crashreport_email}
fi
else
check_startmsgs && echo 'No core dumps found.'
Modified: soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh
==============================================================================
--- soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Mon Jun 11 21:56:37 2012 (r237516)
+++ soc2012/tzabal/client-side/akcrs-head/usr.sbin/crashreport/crashreport.sh Mon Jun 11 22:50:48 2012 (r237517)
@@ -117,9 +117,9 @@
## Find the email that will be used for contact
if [ -z "${_email}" ]; then
- if [ -n "${email}" ]; then
+ if [ -n "${crashreport_email}" ]; then
# email of /etc/rc.conf
- _email="${email}"
+ _email="${crashreport_email}"
else
error 'No email address for contact is specified.'
exit 6
@@ -137,7 +137,8 @@
## Bundle the report
-report="report.tar.gz"
+uniname=`mktemp /tmp/crashreport.XXXXXX`
+report="${uniname##*/}.tar.gz"
email_file=`mktemp /tmp/crashreport.XXXXXX`
echo "${_email}" > ${email_file}
@@ -149,7 +150,7 @@
exit 8
fi
-rm -f "${email_file}"
+rm -f "${uniname}" "${email_file}"
## Send the report to the Central Collector machine
More information about the svn-soc-all
mailing list