Bug#765431: open-iscsi: umountiscsi.sh script does not properly check while traverse sysfs structure

2014-10-15 Thread Dmitry Danilov

Hello,

15.10.2014 17:49, Ritesh Raj Sarraf пишет:

Hello Dmitry,

Thank you for the patch. Since I do not have an iscsi setup handy with
me right now, I'm gonna depend on you for some questions.


On Wednesday 15 October 2014 08:31 AM, Dmitry Danilov wrote:

for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
+   if  ! [ -d $BLOCK_FILE ]; then
+   continue
+   fi


I named the variable BLOCK_FILE. From what I'm guessing, it'd give us
the file names type block. No ??

--
Ritesh Raj Sarraf
RESEARCHUT -http://www.researchut.com
Necessity is the mother of invention.


Yes, as I see, BLOCK_FILE variable should serves that.

--
Dmitry Danilov.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#765431: open-iscsi: umountiscsi.sh script does not properly check while traverse sysfs structure

2014-10-14 Thread Dmitry Danilov
Package: open-iscsi
Version: 2.0.873-3
Severity: important
Tags: patch

Dear Maintainer,

The umountiscsi.sh helper script does not properly check while traverse sysfs 
filesystem for mounted 
iSCSI devices. This cause a problem unmounting / or other filesystems when 
'restart', 'stop' option 
used with open-iscsi init script.

I suggest patch (below) to repair this.



-- System Information:
Debian Release: 7.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages open-iscsi depends on:
ii  libc6  2.13-38+deb7u4
ii  udev   175-7.2

open-iscsi recommends no packages.

open-iscsi suggests no packages.

-- Configuration Files:
/etc/init.d/umountiscsi.sh changed [not included]
/etc/iscsi/initiatorname.iscsi changed [not included]

-- no debconf information
--- umountiscsi.sh	2012-06-28 00:35:52.0 +0700
+++ umountiscsi-20141014.sh	2014-10-14 01:12:35.459559179 +0700
@@ -54,6 +54,9 @@
 			continue
 		fi
 		for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
+			if  ! [ -d $BLOCK_FILE ]; then 
+continue
+			fi
 			BLOCK_DEV=`echo $BLOCK_FILE | sed 's/.*block\///'`
 			DOS_PARTITIONS=`awk /^\/dev\/$BLOCK_DEV/ { print \\$2; }  /proc/mounts`
 			for DEVICE in $DOS_PARTITIONS; do