- Package:
- open-iscsi
- Source:
- open-iscsi
- Description:
- iSCSI initiator tools
- Submitter:
- Peter Gervai
- Date:
- 2025-08-17 17:47:47 UTC
- Severity:
- wishlist
- Tags:
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
The patch looks okay to me. But I am not sure which way we want to go. A better approach could be to use a udev rule. Also someone needs to test this scenario with the newer event based init daemons.
fails, and it's been failing in the last year or so. Yesterday was the day I was able to spend a few hours on testing and finalising. I'm not against udev rules but I didn't master 'em so I don't want to mess around it. Which init do you particularly have in mind? I can install anything on my test VMs until I send them to oblivion. :-) [I'll check them though.] peter
systemd seems to have the most interest right now.
Interesting; popcon says systemd 600+ installed while systemd-sysv is around 70; this is versus upstart 250 installs. I'll try to check them. Peter
I guess most are still passing it as the kernel argument and exploring it. No one wants a broken init.
Probably. Upstart works and requires the patch, but as far as I see it's not really upstarty: it closely emulates sysvinit and doesn't do neither event driven runs nor parallel processing, so no surprise here. For systemd I have to pull up to sid the test system... Peter
The current init script will show you no difference even when run with systemd. What you need is to write a systemd .service for open-iscsi that should honor events and call helper applications (in this case vgchange).
By the current explanation of 'settle' command in the manpage, ideally
it should wait. But it does not.
udevadm settle [options]
Watches the udev event queue, and exits if all current events are
handled.