]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: qa/standalone: Add trap for signals to resetore the kernel core pattern 17026/head
authorDavid Zafman <dzafman@redhat.com>
Tue, 15 Aug 2017 01:17:09 +0000 (18:17 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 15 Aug 2017 02:16:30 +0000 (19:16 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/run-standalone.sh

index 45f69434f9d83f914527ff9c3f8b1c44c90e80d4..f4cde3dd57280d6105a506dc01ecac99d3329db0 100755 (executable)
@@ -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