summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2018-01-16 13:30:51 -0800
committerLee Duncan <lduncan@suse.com>2018-01-16 13:30:51 -0800
commit57b0463df9ec490c88bb979f6305344d07f5803a (patch)
tree3d360ebafb28188ce69bcd2e8ffb04e5e9f22995 /utils
parentc6ae303c2cdd34157dfc3a6dface0a7179e0d401 (diff)
downloadopen-iscsi-57b0463df9ec490c88bb979f6305344d07f5803a.tar.gz
Automate logging into iSCSI FW targets.
Add a script that logs into all iSCSI firmware targets, and add a udev rule to call that script when new targets are detected. Also, add a man page for the script.
Diffstat (limited to 'utils')
-rw-r--r--utils/50-iscsi-firmware-login.rules15
-rw-r--r--utils/iscsi_fw_login12
2 files changed, 27 insertions, 0 deletions
diff --git a/utils/50-iscsi-firmware-login.rules b/utils/50-iscsi-firmware-login.rules
new file mode 100644
index 0000000..47b3cf9
--- /dev/null
+++ b/utils/50-iscsi-firmware-login.rules
@@ -0,0 +1,15 @@
+# This file contains the rules to handle iscsi firmware changes
+
+# DO NOT WRAP THIS LINE
+#
+# old udev does not understand some of it,
+# and would end up skipping only some lines, not the full rule.
+# which can cause all sort of trouble with strange-named device nodes
+# for completely unrelated devices,
+# resulting in unusable network lookback, etc.
+#
+# in case this is "accidentally" installed on a system with old udev,
+# having it as one single line avoids those problems.
+#
+# DO NOT WRAP THIS LINE
+SUBSYSTEM=="iscsi_boot*", ACTION=="add", DEVPATH=="*/target*", RUN+="/sbin/iscsi_fw_login"
diff --git a/utils/iscsi_fw_login b/utils/iscsi_fw_login
new file mode 100644
index 0000000..1312ed3
--- /dev/null
+++ b/utils/iscsi_fw_login
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# iscsi_fw_login -- login to iscsi firmware targets, if any
+#
+# This script is called when udev discovers a new iscsi
+# firmware target
+#
+
+ARGS="-m fw -l"
+ISCSIADM="/sbin/iscsiadm"
+
+$ISCSIADM $ARGS