From: Ian Jackson Date: Tue, 26 Apr 2016 23:33:14 +0000 (+0100) Subject: Backup: Add daft_sleep calls to snapshot code. X-Git-Tag: archive/debian/5.0.0~19 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=f5a069b4c63fd17039e9ffbec54d9e5eca73ce99;p=chiark-utils.git Backup: Add daft_sleep calls to snapshot code. Nowadays udev (and other things) tend to randomly open new block devices, and cause other kinds of trouble. Bodge around this by adding some sleeps. Empirically tested on old-zealot. --- diff --git a/backup/snap-common b/backup/snap-common index 1806a71..99234b1 100644 --- a/backup/snap-common +++ b/backup/snap-common @@ -50,10 +50,17 @@ lvmdevice2vgroup () { vgroup="${vgroup%/*}" } +daft_sleep () { + sleep 5 +} + lvmdropcore () { snmnt="$vardir/snap-mount" + daft_sleep umount -v "$snmnt" || true + daft_sleep test ! -d "$snmnt" || rmdir -- "$snmnt" || rm -f "$snmnt" + daft_sleep set +e old_lv_dev="$(readlink $vardir/snap-device)" @@ -62,7 +69,9 @@ lvmdropcore () { if [ $rc = 0 ]; then set +e + daft_sleep lvremove -f $lvm_lvtools_opts $old_lv_dev + daft_sleep set -e rm $vardir/snap-device fi diff --git a/debian/changelog b/debian/changelog index 64fc918..28e0bc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ chiark-utils (4.5.0~iwj4) unstable; urgency=medium * Add debian/.debhelper to .gitignore. * Backup: No longer attempt to lvchange -a n the snapshot volume. + * Backup: Add daft_sleep calls to snapshot code. --