Package: open-iscsi Version: 2.0.873+git0.3b4b4500-13 Severity: normal Dear Maintainer,
It appears as though open-iscsi always generates a random initiatorName from scratch on installation; either as it runs in the installer, or as it is first installed on the system. Furthermore, this would then lead to the initiatorName changing from in the installer environment and on the installed system, as it seems that /etc/iscsi/initiatorname.iscsi isn't copied from the installer to the target. Now, on some secured setups, the host needs to authenticate also by initiatorName to the target, and that sometimes requires using one's own naming scheme for the initiator name. open-iscsi should allow using a custom initiatorName at least in the installer, where it currently always creates /etc/iscsi/initiatorname.iscsi using iscsi-iname. I've been testing code to allow setting the initiatorName in the installer, but this will only work if there is an added test whether the file exists. Patch follows: --- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.start 2015-08-20 09:51:06.000000000 -0400 +++ open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.start 2016-03-01 15:10:59.000000000 -0500 @@ -4,15 +4,17 @@ # and without all the sanity checks. The installer is a clean environment, so # we don't need all of that. -# Generate a unique InitiatorName and save it -INAME=`iscsi-iname -p iqn.1993-08.org.debian:01` -echo "## DO NOT EDIT OR REMOVE THIS FILE!" > /etc/iscsi/initiatorname.iscsi -echo "## If you remove this file, the iSCSI daemon will not start." >> /etc/iscsi/initiatorname.iscsi -echo "## If you change the InitiatorName, existing access control lists" >> /etc/iscsi/initiatorname.iscsi -echo "## may reject this initiator. The InitiatorName must be unique">> /etc/iscsi/initiatorname.iscsi -echo "## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames." >> /etc/iscsi/initiatorname.iscsi -printf "InitiatorName=$INAME\n" >> /etc/iscsi/initiatorname.iscsi -chmod 600 /etc/iscsi/initiatorname.iscsi +if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then + # Generate a unique InitiatorName and save it + INAME=`iscsi-iname -p iqn.1993-08.org.debian:01` + echo "## DO NOT EDIT OR REMOVE THIS FILE!" > /etc/iscsi/initiatorname.iscsi + echo "## If you remove this file, the iSCSI daemon will not start." >> /etc/iscsi/initiatorname.iscsi + echo "## If you change the InitiatorName, existing access control lists" >> /etc/iscsi/initiatorname.iscsi + echo "## may reject this initiator. The InitiatorName must be unique">> /etc/iscsi/initiatorname.iscsi + echo "## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames." >> /etc/iscsi/initiatorname.iscsi + printf "InitiatorName=$INAME\n" >> /etc/iscsi/initiatorname.iscsi + chmod 600 /etc/iscsi/initiatorname.iscsi +fi modprobe -q iscsi_tcp 2>/dev/null >&2 /sbin/iscsid -- System Information: Debian Release: stretch/sid APT prefers xenial-updates APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500, 'xenial'), (100, 'xenial-backports'), (99, 'xenial-proposed') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.4.0-7-generic (SMP w/4 CPU cores) Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages open-iscsi depends on: ii debconf [debconf-2.0] 1.5.58ubuntu1 ii init-system-helpers 1.28ubuntu2 ii libc6 2.21-0ubuntu6 ii udev 229-1ubuntu4 Versions of packages open-iscsi recommends: ii busybox-initramfs 1:1.22.0-15ubuntu1 open-iscsi suggests no packages. -- Configuration Files: /etc/iscsi/iscsid.conf [Errno 13] Permission non accordée: u'/etc/iscsi/iscsid.conf' -- debconf information excluded