Browse code

Add ISCSI_DEBUG option

This option adds a systemd override to start the iscsi daemon with
debugging enabled.

Change-Id: Ie27991776aa07a695026036e47513221220332a0

Ian Wienand authored on 2019/02/11 10:28:15
Showing 1 changed files
... ...
@@ -183,6 +183,10 @@ TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
183 183
 # and Glance.
184 184
 NOVA_USE_SERVICE_TOKEN=$(trueorfalse False NOVA_USE_SERVICE_TOKEN)
185 185
 
186
+# Enable debugging levels for iscsid service (goes from 0-8)
187
+ISCSID_DEBUG=$(trueorfalse False ISCSID_DEBUG)
188
+ISCSID_DEBUG_LEVEL=${ISCSID_DEBUG_LEVEL:-4}
189
+
186 190
 # Functions
187 191
 # ---------
188 192
 
... ...
@@ -327,8 +331,22 @@ function configure_nova {
327 327
                 sudo chown -R $STACK_USER $NOVA_INSTANCES_PATH
328 328
             fi
329 329
         fi
330
+
331
+        if [[ ${ISCSID_DEBUG} == "True" ]]; then
332
+            # Install an override that starts iscsid with debugging
333
+            # enabled.
334
+            cat > /tmp/iscsid.override <<EOF
335
+[Service]
336
+ExecStart=
337
+ExecStart=/usr/sbin/iscsid -d${ISCSID_DEBUG_LEVEL}
338
+EOF
339
+            sudo mkdir -p /etc/systemd/system/iscsid.service.d
340
+            sudo mv /tmp/iscsid.override /etc/systemd/system/iscsid.service.d/override.conf
341
+            sudo systemctl daemon-reload
342
+        fi
343
+
330 344
         # ensure that iscsid is started, even when disabled by default
331
-        start_service iscsid
345
+        restart_service iscsid
332 346
     fi
333 347
 
334 348
     # Rebuild the config file from scratch