From 982aef784c7f8157a4fc162b38413f7516b3f76d Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 14 Aug 2017 18:17:09 -0700 Subject: [PATCH] tests: qa/standalone: Add trap for signals to resetore the kernel core pattern Signed-off-by: David Zafman --- qa/run-standalone.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qa/run-standalone.sh b/qa/run-standalone.sh index 45f69434f9d..f4cde3dd572 100755 --- a/qa/run-standalone.sh +++ b/qa/run-standalone.sh @@ -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 +} + +trap finish TERM HUP INT + PATH=$(pwd)/bin:$PATH # TODO: Use getops -- 2.39.5