Your message dated Wed, 24 Sep 2025 23:49:14 +0000
with message-id <[email protected]>
and subject line Bug#1116247: fixed in open-iscsi 2.1.11-3
has caused the Debian Bug report #1116247,
regarding open-iscsi: Server with iSCSI root freezes at reboot
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1116247: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1116247
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: open-iscsi
Version: 2.1.11-1+deb13u1
Severity: normal

Dear Maintainer,

We have several diskless servers with iSCSI root arranged in the stack:
btrfs : lvm : gpt : multipath : iscsi. The btrfs filesystem contains subvolumes mounted at / /boot and /var.

The servers host virtual machines with storage arranged as follows:
lvm : multipath : iscsi. The connections to the iscsi targets use vlan-bonding interfaces, where the vlan id for the iSCSI root is different to the one used for virtual disks storage.

This scheme has proved to be reliable over several years and the stability and robustness of open-iscsi is essential for its successful performance. Thanks for your effort in maintaining the quality of the open-iscsi package.

However, at reboot or shutdown the servers were consistently freezing trying to synchronize iscsi devices. After some tests we have recently solved the issue with a modified umountiscsi.sh script. Patch series is attached.

In the tests it was found that:

1. The umountiscsi.sh script tried to disassemble the multipath device that supports the iSCSI root and failed. It was unable to identify that device as support for the root filesystem, exclude it from the disassembly process and add the relevant sessions to the shutdown-keep-sessions file.

2. After umountiscsi.sh exited with an error status the logout-all.sh script is not executed, leaving all iscsi connections open. The open-iscsi.service stop operation exited with failed status.

3. The vlan-bonding interface that supports the virtual machines iscsi storage is deactivated as part of the server shutdown sequence. At this point this interface should have been free because the relevant iscsi sessions were supossed to be closed by the open-iscsi stop operation. The vlan-bonding interface that supports the iscsi root is configured to be kept active at shutdown.

4. The server's kernel tries to synchronize iscsi devices near the end of the shutdown sequence and only succeeds with those involved with the iscsi root. For the rest of iscsi devices connection errors are reported and the shutdown process freezes.

This long standing issue was solved with the following umountiscsi.sh changes:

 1. Create directory for signaling file
 2. Fix detection of LVM VGs with iSCSI storage
 3. Add the path to /var/log/journal to EXCLUDED_MOUNTS
 4. Use lsblk to find more iscsi mount points
 5. Use lsblk to find the major:minor number of a device
 6. Remove unused list iscsi_mount_point_ids

Patches 2, 3 and 4 implement the core of the changes. Patch 5 contains a proposed improvement and patches 1 and 6 address what seem to be minor details.

We hope this patch series can be useful.

Best regards,


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

Kernel: Linux 6.12.43+deb13-amd64 (SMP w/64 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages open-iscsi depends on:
ii  debconf [debconf-2.0]  1.5.91
ii  init-system-helpers    1.69~deb13u1
ii  libc6                  2.41-12
ii  libisns0t64            0.101-1+b1
ii  libkmod2               34.2-2
ii  libmount1              2.41-5
ii  libopeniscsiusr        2.1.11-1+deb13u1
ii  libssl3t64             3.5.1-1
ii  libsystemd0            257.8-1~deb13u2
ii  udev                   257.8-1~deb13u2

Versions of packages open-iscsi recommends:
ii  busybox  1:1.37.0-6+b3

open-iscsi suggests no packages.

-- debconf information:
  open-iscsi/upgrade_even_with_failed_sessions:
  open-iscsi/downgrade_and_break_system:
  open-iscsi/remove_even_with_active_sessions:
  open-iscsi/upgrade_recovery_error:
From f740cec5f0b1d93993c04d69937b5e723a07f45e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Wed, 17 Sep 2025 11:29:18 -0400
Subject: [PATCH 1/6] umountiscsi.sh: create directory for signaling file

If there are no excluded sessions the directory /run/open-iscsi may not
be present at the point when a signaling file is going to be created.
---
 debian/extra/umountiscsi.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index 9c6dfbc..752857a 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -666,6 +666,7 @@ done
 
 # Create signaling file (might be useful)
 if [ $any_umount_failed -eq 1 ] ; then
+	mkdir -p -m 0700 /run/open-iscsi
 	touch /run/open-iscsi/some_umount_failed
 else
 	rm -f /run/open-iscsi/some_umount_failed
-- 
2.51.0

From 2342b6df2b31f925e137ffe629f3dd7523a13108 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Wed, 17 Sep 2025 12:32:13 -0400
Subject: [PATCH 2/6] umountiscsi.sh: fix detection of LVM VGs with iSCSI
 storage

The pvs command seems to be expecting Physical Volumes to be specified
by absolute device paths. When relative paths are provided the command
fails and the LVM volume groups with iSCSI storage are not detected.
---
 debian/extra/umountiscsi.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index 752857a..eca2ec6 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -192,11 +192,8 @@ get_lvm_vgs() {
 	# handle the case where we didn't get passed any PVs
 	# at all
 	[ $# -gt 0 ] || return 0
-	# subshell for pwd change
-	(
-		cd /dev
-		$PVS --noheadings -o vg_name "$@" 2>/dev/null
-	)
+
+	$PVS --noheadings -o vg_name $(printf '/dev/%s ' "$@") 2>/dev/null
 }
 
 enumerate_luks() {
-- 
2.51.0

From d1beecf080a085da63055d41f1963e17af9fcf40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Fri, 19 Sep 2025 13:34:58 -0400
Subject: [PATCH 3/6] umountiscsi.sh: add the path to /var/log/journal to
 EXCLUDED_MOUNTS

In a systemd system the the existence of /var/log/journal directory
indicates that a running journald daemon may be using it when
umountiscsi.sh is called, therefore /var /var/log and /var/log/journal
are excluded to avoid an umount error when a iscsi device is involved.

When umountiscsi.sh exits with an error status logout-all.sh is not
called and that may generate large delays or a freeze when the server
tries to synchronize the devices at shutdown or reboot.
---
 debian/extra/umountiscsi.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index eca2ec6..8a0b641 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -72,10 +72,14 @@ DRY_RUN=0
 
 # We need to make sure that we don't try to umount the root device
 # and for systemd systems, also /usr (which is pre-mounted in initrd
-# there).
+# there) and the path to /var/log/journal when this directory
+# exists.
 EXCLUDE_MOUNTS="/"
 if [ -d /run/systemd/system ] ; then
         EXCLUDE_MOUNTS="$EXCLUDE_MOUNTS /usr"
+	if [ -d /var/log/journal ] ; then
+		EXCLUDE_MOUNTS="$EXCLUDE_MOUNTS /var /var/log /var/log/journal"
+	fi
 fi
 EXCLUDE_MOUNTS="${EXCLUDE_MOUNTS}${EXCLUDE_MOUNTS_AT_SHUTDOWN+ $EXCLUDE_MOUNTS_AT_SHUTDOWN}"
 unset _EXCLUDE_MOUNTS
-- 
2.51.0

From 28df1b8f795645f21759b8583798519e47d1d183 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Fri, 19 Sep 2025 14:35:32 -0400
Subject: [PATCH 4/6] umountiscsi.sh: use lsblk to find more iscsi mount points

A mounted btrfs subvolume is listed with zero as device major number in
/proc/self/mountinfo, preventing its identification as part of the
iscsi_potential_mount_sources_majmin list. When the mountpoint is one
of the EXCLUDED_MOUNTS that would also leave an incomplete list of sessions
to exclude.

The issue is solved using lsblk to find more iscsi mounts to deactivate and
more sessions to exclude. The resulting iscsi_mount_points list is sorted in
reverse order with duplicates removed. The situation where multiple mountpoints
are using the same device is supported. The hexadecimal escape sequences that
may use lsblk are changed to the octal equivalents, in order to keep congruence
with /proc/self/mountinfo and compatibility with the dash shell.

As the dash shell only supports octal escape sequences, the hex to octal
conversion is performed by an awk script that uses the support for hexadecimal
number strings provided in the POSIX compliant mode.

The code uses lsblk, mawk, sed and sort, commands that should be
available in this context as they are provided by required packages.
---
 debian/extra/umountiscsi.sh | 42 +++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index 8a0b641..1bac84b 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -56,6 +56,8 @@ VGS=/sbin/vgs
 VGCHANGE=/sbin/vgchange
 CRYPTSETUP=/sbin/cryptsetup
 DMSETUP=/sbin/dmsetup
+AWK="/usr/bin/mawk -Wposix"
+LSBLK=/usr/bin/lsblk
 
 if [ -x $PVS ] && [ -x $LVS ] && [ -x $VGCHANGE ] ; then
 	HAVE_LVM=1
@@ -180,6 +182,20 @@ hash_add_to_set() {
 	add_to_set "${_hash_add_to_set_var}" "$@"
 }
 
+hex_escape_to_octal_escape () {
+	_str=$(
+		printf '%s' "${2}" | $AWK '{
+			i=$0; o="";
+			while(r=match(i,/\\x([0-9a-fA-F]{2})/)){
+				o=o substr(i,1,r) sprintf("%03o", "0" substr(i,r+1,3));
+				i=substr(i,r+4);
+			}
+			print o i
+		}'
+	)
+	eval $1=\${_str}
+}
+
 device_majmin() {
 	eval $1=\"\"
 	_majmin_dec=$(LC_ALL=C ls -lnd /dev/"$2" | while read _perms _links _uid _gid _majcomma _min _rest ; do
@@ -393,6 +409,32 @@ enumerate_iscsi_devices() {
 			iscsi_mount_point_ids="$_mpid $iscsi_mount_points"
 		fi
 	done < /proc/self/mountinfo
+
+	# Find sessions to exclude using lsblk. Add iscsi mounts to iscsi_mount_points list.
+	# Handle the case where multiple mountpoints are reported for one device, separated
+	# by vertical whitespace.
+	while read -r _majmin _mnts; do
+		test -z "${_mnts}" && continue
+		if in_set iscsi_potential_mount_sources_majmin "${_majmin}" ; then
+			hex_escape_to_octal_escape _mnts "${_mnts}"
+			for _mntp in $(printf '%s' "${_mnts}" | sed 's/\\01[2-5]/ /g'); do
+				if in_set EXCLUDE_MOUNTS "${_mntp}" ; then
+					hash_get _dev_sessions ISCSI_NUMDEVICE_SESSIONS "${_majmin}"
+					add_to_set ISCSI_EXCLUDED_SESSIONS $_dev_sessions
+				else
+					# Push mountpoint to the top of the list
+					# to reverse the order provided by lsblk
+					iscsi_mount_points="${_mntp} $iscsi_mount_points"
+				fi
+			done
+		fi
+	done <<- EOF
+		$($LSBLK -r --noheadings -o MAJ:MIN,MOUNTPOINTS -s -x MOUNTPOINTS 2>/dev/null)
+	EOF
+	# Sort iscsi_mount_points list in reverse order and remove duplicates
+	iscsi_mount_points=$(
+		printf '%s ' $(printf '%s\n' ${iscsi_mount_points} | sort -r -u) | $AWK '{$1=$1}1'
+	)
 }
 
 try_umount() {
-- 
2.51.0

From e03ca0746205a353040d8cb808ebeaa6979f714c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Fri, 19 Sep 2025 15:56:20 -0400
Subject: [PATCH 5/6] umountiscsi.sh: use lsblk to find the major:minor number
 of a device

The major:minor number of a device can be obtained directly using lsblk.
This command should be available in this context because it's provided
by a required package.
---
 debian/extra/umountiscsi.sh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index 1bac84b..85efab8 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -198,12 +198,7 @@ hex_escape_to_octal_escape () {
 
 device_majmin() {
 	eval $1=\"\"
-	_majmin_dec=$(LC_ALL=C ls -lnd /dev/"$2" | while read _perms _links _uid _gid _majcomma _min _rest ; do
-		if [ x"${_majcomma%,}"x != x"${_majcomma}"x ] ; then
-			printf '%s' ${_majcomma%,}:${_min}
-		fi
-		break
-	done)
+	_majmin_dec=$($LSBLK --raw --noheadings --nodeps --output MAJ:MIN /dev/"$2" 2>/dev/null)
 	[ -n "${_majmin_dec}" ] || return
 	eval $1=\${_majmin_dec}
 }
-- 
2.51.0

From 9b738374390c5a4d7a572826056c28da725625fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dhionel=20D=C3=ADaz?= <[email protected]>
Date: Fri, 19 Sep 2025 16:07:22 -0400
Subject: [PATCH 6/6] umountiscsi.sh: remove unused list iscsi_mount_point_ids

---
 debian/extra/umountiscsi.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/debian/extra/umountiscsi.sh b/debian/extra/umountiscsi.sh
index 85efab8..ef13192 100755
--- a/debian/extra/umountiscsi.sh
+++ b/debian/extra/umountiscsi.sh
@@ -387,7 +387,6 @@ enumerate_iscsi_devices() {
 
 	# Enumerate mount points
 	iscsi_mount_points=""
-	iscsi_mount_point_ids=""
 	while read _mpid _mppid _mpdev _mpdevpath _mppath _mpopts _other ; do
 		if in_set iscsi_potential_mount_sources_majmin "$_mpdev" ; then
 			if in_set EXCLUDE_MOUNTS "${_mppath}" ; then
@@ -401,7 +400,6 @@ enumerate_iscsi_devices() {
 			# reflect the stacking order, so this is not
 			# fool-proof, but it's better than nothing
 			iscsi_mount_points="$_mppath $iscsi_mount_points"
-			iscsi_mount_point_ids="$_mpid $iscsi_mount_points"
 		fi
 	done < /proc/self/mountinfo
 
-- 
2.51.0

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: open-iscsi
Source-Version: 2.1.11-3
Done: Chris Hofstaedtler <[email protected]>

We believe that the bug you reported is fixed in the latest version of
open-iscsi, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Hofstaedtler <[email protected]> (supplier of updated open-iscsi package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 25 Sep 2025 01:25:31 +0200
Source: open-iscsi
Architecture: source
Version: 2.1.11-3
Distribution: unstable
Urgency: medium
Maintainer: Debian iSCSI Maintainers <[email protected]>
Changed-By: Chris Hofstaedtler <[email protected]>
Closes: 1030478 1056733 1116247
Changes:
 open-iscsi (2.1.11-3) unstable; urgency=medium
 .
   [ Carles Pina i Estany ]
   * [4776d36] Added po-debconf Catalan translation
 .
   [ Lena Voytek ]
   * [8c864ed] Include iscsiuio.socket in iscsiuio package (LP: #2072484)
     (Closes: #1056733)
 .
   [ Chris Hofstaedtler ]
   * [ca6ccc5] Remove traces of usrmerge compat symlinks (Closes: #1030478)
 .
   [ Dhionel Díaz ]
   * [81e277b] umountiscsi.sh: create directory for signaling file
   * [b5e829b] umountiscsi.sh: fix detection of LVM VGs with iSCSI storage
   * [9126e8f] umountiscsi.sh: add the path to /var/log/journal to 
EXCLUDED_MOUNTS
   * [fc9e7a1] umountiscsi.sh: use lsblk to find more iscsi mount points
   * [85ccdc9] umountiscsi.sh: use lsblk to find the major:minor number of a 
device
   * [6e71484] umountiscsi.sh: remove unused list iscsi_mount_point_ids
     Closes: #1116247
Checksums-Sha1:
 c6a5dd315ac3c6c9d2f74a1096df6f0d3b9fd979 2586 open-iscsi_2.1.11-3.dsc
 bcc80cdc6611125614231d0eb49bb50f4de09e4c 59532 
open-iscsi_2.1.11-3.debian.tar.xz
 e188e1c9c3f6d78fa7edeb70104da03d4bc3537d 9077 
open-iscsi_2.1.11-3_arm64.buildinfo
Checksums-Sha256:
 330ef9e2b94c94140055915cd07caba9b0a356649bcdc35287cd891a9fa2e354 2586 
open-iscsi_2.1.11-3.dsc
 36f1a4c29a04c327861e0e6fae996869fd550a51584870d8228d43ce95e298a9 59532 
open-iscsi_2.1.11-3.debian.tar.xz
 3c7453e2d8c485cc95ac2478d2c1268606928c43b9482d76d032d91b20c9e063 9077 
open-iscsi_2.1.11-3_arm64.buildinfo
Files:
 869d7ce76b0a321c56a6177d7eb9290a 2586 net optional open-iscsi_2.1.11-3.dsc
 cac5463a5b2fed6382b15d6c318618bc 59532 net optional 
open-iscsi_2.1.11-3.debian.tar.xz
 2c2cfd429640797b4963bc11ee08abb5 9077 net optional 
open-iscsi_2.1.11-3_arm64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfRrP+tnggGycTNOSXBPW25MFLgMFAmjUf9cACgkQXBPW25MF
LgMDnw/8CLXGghhkWsGpBde+aVUQFu5H7IEH4cfxIoTwL9jMH0ziEoeIn2z8r3s3
m1Nd40jfRJXpFb1JQIvOw3EsI1Sgyh7iVT3qa986mfA2mz/ariz9ypYJNJM2OnrE
DFiCxH4NW8lDYk2ybaPvbja7wiggGqu2HuIhUoVrOYfM4dSDKyWTt2okXrKQFrWO
AoLpp9wFatZJYXsEMnuABQLiwOw3wyo99HF0TlNrDv9LvDA6vA7llJrWAhF25bfA
cFYN1ryjkKMTcZqv62yZz/kt64HQce/WX/FpdaUKHddf+c/XJKCTnXjsWxl6hi/7
QStb2ngXTTQ9G6Cw/EvFHUNVeiC0eJ2E2xOg+wVvaqeAnK1tRcCMjR2A2v8wt/aI
1nnN7PUaVAGcSJ0mJhjBtz9XlByjXnbuCz+U1K61BwkVKgBTJGRppLZBZht9TNqr
fVkg54cKB9b4ijKhJ/vh7tOp8Ak/srijohBu4WWfGEfwmojO9QmWPrzGPg9P6J/B
YzfH4YfBeoKgXAjZ4kofCkBuZcVBjeiG/o2BA2AcE+JqMX0n2lcdccuV4nP85Mx7
WjhjOad96EoiFqphX5TeflX71X0W3ydkBGZh6zuwxSFA7VXinkI1ZrFPyRxTVxxP
b+uwgCUWF3+SOQBSQBSlZQyTOa1xgUH7XtCIFNCeivMshz7eZmk=
=LP8h
-----END PGP SIGNATURE-----

Attachment: pgpzZRgorbtlO.pgp
Description: PGP signature


--- End Message ---

Reply via email to