crash-reporter: fix race condition between cron crash_sender and test invoked
Change-Id: I274072faffcb49b1910352cbcc5005e3144d9ab0
BUG=7765
TEST=CrashSender and UserCrash
Review URL: http://codereview.chromium.org/3748011
diff --git a/crash_reporter/crash_sender b/crash_reporter/crash_sender
index c9eec05..244c31d 100644
--- a/crash_reporter/crash_sender
+++ b/crash_reporter/crash_sender
@@ -28,6 +28,9 @@
# Path to hardware class description.
HWCLASS_PATH="/sys/devices/platform/chromeos_acpi/HWID"
+# Ignore PAUSE_CRASH_SENDING file if set.
+OVERRIDE_PAUSE_SENDING=${OVERRIDE_PAUSE_SENDING:-0}
+
# Maximum crashes to send per day.
MAX_CRASH_RATE=${MAX_CRASH_RATE:-32}
@@ -343,7 +346,8 @@
main() {
trap cleanup EXIT INT TERM
- if [ -e "${PAUSE_CRASH_SENDING}" ]; then
+ if [ -e "${PAUSE_CRASH_SENDING}" ] && \
+ [ ${OVERRIDE_PAUSE_SENDING} -eq 0 ]; then
lecho "Exiting early due to ${PAUSE_CRASH_SENDING}."
exit 1
fi