[Pkg-iscsi-maintainers] Bug#686595: open-iscsi: Try harder to start LVM when the device synchronisation take more time

Peter Gervai grin at grin.hu
Mon Sep 3 17:02:30 UTC 2012


Package: open-iscsi
Version: 2.0.873-3
Severity: important
Tags: patch

My devices reside on multiple hosts using all kinds of troublesome parameters (drbd, slow links, virtualised machines, etc)
which results 2-3 seconds between iscsi login and the devices recognised by the kernel. open-iscsi start script wasn't
quite patient, declared no vg's available (in fact no pv's at the point of time), and failed to mount the whole
shebang.

This patch make it a bit more patient, trying 10 times 1 second to get it done. These parameters could be
configured, changed etc., it is just good for the average around me. Should not hurt anyone I guess, unless
I screwed up the script, which is quite possible.

Thanks,
Peter


diff -r f060bdd7bf69 init.d/open-iscsi
--- a/init.d/open-iscsi Mon Sep 03 18:27:47 2012 +0200
+++ b/init.d/open-iscsi Mon Sep 03 18:53:13 2012 +0200
@@ -117,7 +117,13 @@
                log_daemon_msg "Activating iSCSI volume groups"
                for vg in "$LVMGROUPS"; do
                        log_progress_msg $vg
-                       vgchange --available=y $vg
+                       for try in `seq 1 10`; do
+                               if vgchange --available=y $vg; then break; fi
+                               log_daemon_msg "$vg is not yet available, waiting 1 second... (try $try)"
+                               # you may have to raise repeat and sleep if your dev syncronises even slower
+                               sleep 1;
+                       done
+
                done
                log_end_msg 0
        fi



More information about the Pkg-iscsi-maintainers mailing list