73ad23
From 90054e4f1f2f64cb9a2b06b44b5a82b293c387dd Mon Sep 17 00:00:00 2001
73ad23
From: Lukas Nykryn <lnykryn@redhat.com>
73ad23
Date: Thu, 10 Jan 2019 18:08:32 +0100
73ad23
Subject: [PATCH] 95iscsi: decouple iscsi from sysinit.target
73ad23
73ad23
---
73ad23
 modules.d/95iscsi/module-setup.sh | 17 +++++++++++++++++
73ad23
 1 file changed, 17 insertions(+)
73ad23
73ad23
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
73ad23
index 5c2073bb..ae1924cc 100755
73ad23
--- a/modules.d/95iscsi/module-setup.sh
73ad23
+++ b/modules.d/95iscsi/module-setup.sh
73ad23
@@ -265,6 +265,23 @@ install() {
73ad23
             echo "After=dracut-cmdline.service"
73ad23
             echo "Before=dracut-initqueue.service"
73ad23
         ) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf"
73ad23
+
73ad23
+        # The iscsi deamon does not need to wait for any storage inside initrd
73ad23
+        mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.socket.d"
73ad23
+        (
73ad23
+            echo "[Unit]"
73ad23
+            echo "DefaultDependencies=no"
73ad23
+            echo "Conflicts=shutdown.target"
73ad23
+            echo "Before=shutdown.target sockets.target"
73ad23
+        ) > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf"
73ad23
+        mkdir -p "${initdir}/$systemdsystemunitdir/iscsuio.socket.d"
73ad23
+        (
73ad23
+            echo "[Unit]"
73ad23
+            echo "DefaultDependencies=no"
73ad23
+            echo "Conflicts=shutdown.target"
73ad23
+            echo "Before=shutdown.target sockets.target"
73ad23
+        ) > "${initdir}/$systemdsystemunitdir/iscsuio.socket.d/dracut.conf"
73ad23
+
73ad23
     fi
73ad23
     inst_dir /var/lib/iscsi
73ad23
     dracut_need_initqueue
73ad23