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

Bug #1800681 reported by Dimitri John Ledkov on 2018-10-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
open-iscsi (Ubuntu)

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 @@

+# 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
 exit 0

tags: added: id-5bbe5cb1a3a04d69ef6d9037
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package open-iscsi - 2.0.874-5ubuntu13

open-iscsi (2.0.874-5ubuntu13) disco; urgency=medium

  [ Robert C Jennings & Dimitri John Ledkov ]
  * If iscsi root was requested, but no iscsi devices were mounted, remove
    the initramfs interfaces stamp file. Meaning, that on shutdown there
    is no 30s delay, whilst trying to re-establish iscsi login to perform
    a logout. LP: #1800681

 -- Dimitri John Ledkov <email address hidden> Sun, 09 Dec 2018 22:29:20 +0000

Changed in open-iscsi (Ubuntu Disco):
status: New → Fix Released
David Krauser (davidkrauser) wrote :

I tested this fix on disco, and it appears to be working as intended.

The issue still exists on bionic, however.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers