Adding a lock mechanism to crash_sender.
This is to avoid situations when crash_sender is already running and while test crash reporting, we execute crash_sender manually. BUG=None TEST=Manually Change-Id: I3beea8d503940d7a1af24c8f16eebb365d447434 Reviewed-on: https://gerrit.chromium.org/gerrit/65556 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Rohit Makasana <rohitbm@chromium.org> Reviewed-by: Rohit Makasana <rohitbm@chromium.org> Tested-by: Rohit Makasana <rohitbm@chromium.org>
This commit is contained in:
parent
2aa552ad43
commit
c3f7973c24
1 changed files with 9 additions and 0 deletions
|
|
@ -18,6 +18,9 @@ CLEAN_UP_RUN_FILE=0
|
|||
# contents includes our machine's anonymized guid.
|
||||
CONSENT_ID="/home/chronos/Consent To Send Stats"
|
||||
|
||||
# Crash sender lock in case the sender is already running.
|
||||
CRASH_SENDER_LOCK="/var/lock/crash_sender"
|
||||
|
||||
# Path to file that indicates a crash test is currently running.
|
||||
CRASH_TEST_IN_PROGRESS_FILE="/tmp/crash-test-in-progress"
|
||||
|
||||
|
|
@ -569,4 +572,10 @@ main() {
|
|||
done
|
||||
}
|
||||
|
||||
(
|
||||
if ! flock -n 9; then
|
||||
lecho "crash_sender is already running; quitting."
|
||||
exit 1
|
||||
fi
|
||||
main
|
||||
) 9>"${CRASH_SENDER_LOCK}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue