Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: qa/standalone: Add trap for signals to restore the kernel core pattern #17026

Merged
merged 1 commit into from
Aug 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions qa/run-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ else
COREPATTERN="core.%e.%p.%t"
fi

function finish() {
if [ -n "$precore" ]; then
sudo sysctl -w ${KERNCORE}=${precore}
fi
exit 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to exit 0. and might want to reuse this function at https://github.com/ceph/ceph/pull/17026/files#diff-5e483a2d055861968b99eacaa3688b6fR108.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov With daemons running if I don't exit here weird things happened. I don't remember exactly what happened, but I tried it with a common function. I think I had to ^C twice to get the test to stop running.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, okay then!

}

trap finish TERM HUP INT

PATH=$(pwd)/bin:$PATH

# TODO: Use getops
Expand Down