summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2018-10-19 16:38:16 +0200
committerMichael Scherer <misc@redhat.com>2018-10-19 16:38:16 +0200
commit8f708f2e393aa512f70a673246618285de187b3c (patch)
tree050000115461eda6ac6566f10a4806cf5b8adcca
parente1792cd73bb6e3bb960f7efae1e08a2a7d5bc213 (diff)
Add a cleanup function, fix #1641021
The script first try to cleanly remove process, and then is more forceful. The list of process have been taken from failure in the bugs, but maybe a reboot is better, as it would also get ride of mount. Change-Id: Ib775eef63aecb048afbc6c74b6c9603831eba352
-rw-r--r--build-gluster-org/scripts/gd2-smoke.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/build-gluster-org/scripts/gd2-smoke.sh b/build-gluster-org/scripts/gd2-smoke.sh
index ade6c12..b69c1bb 100644
--- a/build-gluster-org/scripts/gd2-smoke.sh
+++ b/build-gluster-org/scripts/gd2-smoke.sh
@@ -2,6 +2,14 @@
set -e
+function cleanup() {
+ killall glusterfs etcd make glusterd2
+ sleep 5
+ killall -9 glusterfs etcd make glusterd2
+}
+
+trap cleanup ERR
+
JDIRS="/var/log/glusterfs /var/lib/glusterd /var/run/gluster /build"
sudo rm -rf $JDIRS
sudo mkdir -p $JDIRS || true