[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#853990: Add prompt for iSCSI initiator name in installer



Package: partman-iscsi
Version: 44

The installer should prompt for the desired iSCSI initiator name before
starting the initiator. Many iSCSI targets require the specification of
the IQN as part of their ACLs. It is useful for the administrator to be
able to set this.

I have included a patch based on Ubuntu's modifications to the package
that appears to achieve this.

--- iscsi-base.sh	2011-07-24 21:01:40.000000000 -0400
+++ /tmp/iscsi-base.sh	2017-02-02 16:17:27.583471157 -0500
@@ -1,5 +1,22 @@
 . /usr/share/debconf/confmodule
 
+iscsi_start () {
+	db_input critical partman-iscsi/initiatorname || true
+	db_go || true
+	db_get partman-iscsi/initiatorname
+	if [ -n "$RET" ]; then
+	        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=$RET\n"  >> /etc/iscsi/initiatorname.iscsi
+	        chmod 600 /etc/iscsi/initiatorname.iscsi
+	fi
+
+	iscsi-start
+}
+
 iscsi_login () {
 	local portal discovery targets target
 	local state=0


Reply to: