Skip to content

Commit

Permalink
CA-333441 create directory for set-iscsi-initiator
Browse files Browse the repository at this point in the history
It appears that the directory structure for the set-iscsi-initiator script
was missing. The directory /var/lock/sm/iscsiadm was created.

Also, when there is an active session, an error is displayed to the user.

Signed-off-by: Gheorghe Burac <gheorghe.burac@citrix.com>
  • Loading branch information
Gheorghe Burac committed Sep 23, 2020
1 parent 21dafdc commit 9422c9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/set-iscsi-initiator
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ trap cleanup EXIT
trap ecleanup INT
trap ecleanup TERM

mkdir -p /var/lock/sm/iscsiadm

INITIATORFILE=/etc/iscsi/initiatorname.iscsi
TMPFILE=$TMPDIR/initiatorname.iscsi

Expand All @@ -40,6 +42,7 @@ TMPFILE=$TMPDIR/initiatorname.iscsi
if [ $? -eq 0 ]
then
logger -p local2.err "set-iscsi-initiator active sessions so not updating"
echo "set-iscsi-initiator: there are active sessions so not updating"
exit 1
fi

Expand Down

0 comments on commit 9422c9e

Please sign in to comment.