Skip to content

Commit

Permalink
Low: resources: clean serialized file on SIGTERM in Dummy
Browse files Browse the repository at this point in the history
Otherwise it could give a false probe error at next start,
confusing whatever else is being tested with a dummy resource.
Unfortunately this doesn't help if an in-flight monitor gets
cancelled with a SIGKILL, but there's no obvious solution there.
  • Loading branch information
kgaillot committed Jan 10, 2019
1 parent bf2463c commit 490ef9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extra/resources/Dummy
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ END
trap sigterm_handler TERM
sigterm_handler() {
ocf_log info "They use TERM to bring us down. No such luck."

# Since we're likely going to get KILLed, clean up any monitor
# serialization in progress, so the next probe doesn't return an error.
rm -f "${VERIFY_SERIALIZED_FILE}"
return
}

Expand Down Expand Up @@ -171,6 +175,7 @@ dummy_monitor() {
# two monitor ops have occurred at the same time.
# This verifies a condition in pacemaker-execd regression tests.
ocf_log err "$VERIFY_SERIALIZED_FILE exists already"
ocf_exit_reason "alternate universe collision"
return $OCF_ERR_GENERIC
fi

Expand Down

0 comments on commit 490ef9f

Please sign in to comment.