[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, master, updated. 2.0.871.3-1-24-ga79a06d
Ritesh Raj Sarraf
rrs at researchut.com
Tue Jun 8 18:23:53 UTC 2010
The following commit has been merged in the master branch:
commit 04e956a04e2cd30defb33f6d09c5dbf632cd3c6c
Author: Ritesh Raj Sarraf <rrs at researchut.com>
Date: Tue Jun 8 12:19:49 2010 +0530
Hanlde LVM devices and devices marked _netdev
This comes with a caveat that all devices (includes NFS shares too)
marked _netdev will be (mis)handled
diff --git a/debian/changelog b/debian/changelog
index dea466c..ea428f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,9 @@ open-iscsi (2.0.871.3-2) UNRELEASED; urgency=low
* Document the odd hang behavior during iSCSI login phase when using 32 bit
open-iscsi with 64 bit kernel
* Change address to my official Debian address and remove the DMUA flag
+ * Handle iSCSI LVM devices and devices marked _netdev (Closes: #498616)
- -- Ritesh Raj Sarraf <rrs at debian.org> Thu, 06 May 2010 11:40:52 +0530
+ -- Ritesh Raj Sarraf <rrs at debian.org> Tue, 08 Jun 2010 12:18:03 +0530
open-iscsi (2.0.871.3-1) unstable; urgency=low
diff --git a/debian/open-iscsi.default b/debian/open-iscsi.default
new file mode 100644
index 0000000..923ac58
--- /dev/null
+++ b/debian/open-iscsi.default
@@ -0,0 +1,9 @@
+# List of LVMed iSCSI Volume Groups.
+# Multiple Volume Groups can be specified with spaces
+LVMGROUPS=""
+
+
+# Handle _netdev devices
+# Hanling _netdev devices comes with the caveat that other _netdev mounts
+# like an NFS share also get pulled in with it
+HANDLE_NETDEV=1
diff --git a/debian/open-iscsi.init b/debian/open-iscsi.init
index 9181331..2a04c3c 100644
--- a/debian/open-iscsi.init
+++ b/debian/open-iscsi.init
@@ -19,6 +19,12 @@ CONFIGFILE=/etc/iscsi/iscsid.conf
. /lib/lsb/init-functions
+# Include defaults if available
+if [ -f /etc/default/open-iscsi ]; then
+ . /etc/default/open-iscsi
+fi
+
+
if [ ! -d /sys/class/ ]; then
log_failure_msg "iSCSI requires a mounted sysfs, not started."
exit 0
@@ -100,6 +106,23 @@ start() {
udevadm settle
fi
+
+ # Handle iSCSI LVM devices
+ if [ ! -x "/sbin/vgchange" -a -n "$LVMGROUPS" ]; then
+ log_warning_msg "LVM2 tools are not installed, not honouring LVMGROUPS."
+ LMVGROUPS=""
+ fi
+
+ if [ -n "$LVMGROUPS" ]; then
+ log_daemon_msg "Activating iSCSI volume groups"
+ for vg in "$LVMGROUPS"; do
+ log_progress_msg $vg
+ vgchange --available=y $vg
+ done
+ log_end_msg 0
+ fi
+
+ # Now let's mount
log_daemon_msg "Mounting network filesystems"
MOUNT_RESULT=1
if mount -a -O _netdev >/dev/null 2>&1; then
diff --git a/debian/open-iscsi.install b/debian/open-iscsi.install
new file mode 100644
index 0000000..ef6750b
--- /dev/null
+++ b/debian/open-iscsi.install
@@ -0,0 +1 @@
+open-iscsi.default /etc/default/open-iscsi
diff --git a/debian/umountiscsi.sh.init b/debian/umountiscsi.sh.init
index 1f8e11a..a1a1f51 100644
--- a/debian/umountiscsi.sh.init
+++ b/debian/umountiscsi.sh.init
@@ -12,11 +12,38 @@
. /lib/lsb/init-functions
+
+# Include defaults if available
+if [ -f /etc/default/open-iscsi ]; then
+ . /etc/default/open-iscsi
+fi
+
+
do_stop () {
log_daemon_msg "Unmounting iscsi-backed filesystems"
umount_fail=0
+ if [ $HANDLE_NETDEV -eq 1 ]; then
+ log_progress_msg "Unmounting all devices marked _netdev";
+ umount -a -O _netdev >/dev/null 2>&1
+ fi
+
+
+ # Now handle iSCSI LVM Volumes
+ if [ -n "$LVMGROUPS" ]; then
+ log_daemon_msg "Deactivating iSCSI volume groups"
+ for vg in "$LVMGROUPS"; do
+ log_progress_msg $vg
+ vgchange --available=n $vg
+ if [ $? -ne 0 ]; then
+ log_warning_msg "Cannot deactivate Volume Group $vg"
+ umount_fail=1
+ fi
+ done
+ log_end_msg 0
+ fi
+
for HOST_DIR in /sys/devices/platform/host*; do
if ! [ -d $HOST_DIR/iscsi_host* ]; then
continue
--
Debian Open-iSCSI Packaging
More information about the Pkg-iscsi-maintainers
mailing list