[Bug 1800681] [NEW] open-iscsi should not leave around the stamp file if no connections were made

Dimitri John Ledkov launchpad at surgut.co.uk
Tue Oct 30 16:16:00 UTC 2018


Public bug reported:

open-iscsi should not leave around the stamp file if no connections were
made


open-iscsi finalrd hook is sensitive to /run/initramfs/open-iscsi.interface as an indicator that rootfs might have been an iscsi mount, and thus logout needs to happen inside finalrd.

However, in auto-mode, and without any iscsi hard-drives found, that
stamp file is still left around. It should be cleaned up, such that such
boots do not result in 30s shutdown delay.

Proposed patch is this:

/usr/share/initramfs-tools/scripts/local-top$ diff -u iscsi.orig iscsi
--- iscsi.orig	2018-10-30 15:53:36.314256545 +0000
+++ iscsi	2018-10-30 15:53:02.883686328 +0000
@@ -360,4 +360,19 @@
 	done
 fi
 
+# Remove the interface file if no disks are present
+if [ -f /run/initramfs/open-iscsi.interface ] ; then
+	found=0
+	for disk in /dev/disk/by-path/*-iscsi-*; do
+		if ! "$(readlink -f "$disk")" ; then
+			continue
+		fi
+		found=1
+		break;
+	done
+	if [ $found = 0 ] ; then
+		rm /run/initramfs/open-iscsi.interface
+	fi
+fi
+
 exit 0

** Affects: open-iscsi (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: open-iscsi (Ubuntu Bionic)
     Importance: Undecided
         Status: New

** Affects: open-iscsi (Ubuntu Cosmic)
     Importance: Undecided
         Status: New

** Affects: open-iscsi (Ubuntu Disco)
     Importance: Undecided
         Status: New

** Also affects: open-iscsi (Ubuntu Disco)
   Importance: Undecided
       Status: New

** Also affects: open-iscsi (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Also affects: open-iscsi (Ubuntu Cosmic)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1800681

Title:
  open-iscsi should not leave around the stamp file if no connections
  were made

Status in open-iscsi package in Ubuntu:
  New
Status in open-iscsi source package in Bionic:
  New
Status in open-iscsi source package in Cosmic:
  New
Status in open-iscsi source package in Disco:
  New

Bug description:
  open-iscsi should not leave around the stamp file if no connections
  were made

  
  open-iscsi finalrd hook is sensitive to /run/initramfs/open-iscsi.interface as an indicator that rootfs might have been an iscsi mount, and thus logout needs to happen inside finalrd.

  However, in auto-mode, and without any iscsi hard-drives found, that
  stamp file is still left around. It should be cleaned up, such that
  such boots do not result in 30s shutdown delay.

  Proposed patch is this:

  /usr/share/initramfs-tools/scripts/local-top$ diff -u iscsi.orig iscsi
  --- iscsi.orig	2018-10-30 15:53:36.314256545 +0000
  +++ iscsi	2018-10-30 15:53:02.883686328 +0000
  @@ -360,4 +360,19 @@
   	done
   fi
   
  +# Remove the interface file if no disks are present
  +if [ -f /run/initramfs/open-iscsi.interface ] ; then
  +	found=0
  +	for disk in /dev/disk/by-path/*-iscsi-*; do
  +		if ! "$(readlink -f "$disk")" ; then
  +			continue
  +		fi
  +		found=1
  +		break;
  +	done
  +	if [ $found = 0 ] ; then
  +		rm /run/initramfs/open-iscsi.interface
  +	fi
  +fi
  +
   exit 0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1800681/+subscriptions



More information about the foundations-bugs mailing list