#!/bin/sh mkdir -p $SNAP_COMMON/etc/iscsi/ INAME_FILE=$SNAP_COMMON/etc/iscsi/initiatorname.iscsi if ! [ -f $INAME_FILE ]; 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!" > $INAME_FILE echo "## If you remove this file, the iSCSI daemon will not start." >> $INAME_FILE echo "## If you change the InitiatorName, existing access control lists" >> $INAME_FILE echo "## may reject this initiator. The InitiatorName must be unique">> $INAME_FILE echo "## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames." >> $INAME_FILE printf "InitiatorName=$INAME\n" >> $INAME_FILE chmod 600 $INAME_FILE fi exec $SNAP/sbin/iscsid -p $SNAP_COMMON/var/run/iscsid.pid --initiatorname=$INAME_FILE --config=$SNAP_COMMON/etc/iscsi/iscsid.conf