From 0eb87d78108aae9aa4692f1edfb33ded50e26409 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 26 Apr 2021 10:05:06 +0200 Subject: [PATCH] fix(iscsi): only rely on socket activiation Only rely on socket activation. This speeds up in case iscsi isn't used and also prevents failures, where iscsiuio stopping somehow disables iscsi. --- modules.d/95iscsi/module-setup.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh index fe730adc8d..16c99f7a40 100755 --- a/modules.d/95iscsi/module-setup.sh +++ b/modules.d/95iscsi/module-setup.sh @@ -235,21 +235,14 @@ install() { $SYSTEMCTL -q --root "$initdir" enable "$i" done - for i in \ - iscsid.service \ - iscsiuio.service; do - $SYSTEMCTL -q --root "$initdir" add-wants basic.target "$i" - done - - # Make sure iscsid is started after dracut-cmdline and ready for the initqueue mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d" ( echo "[Unit]" - echo "After=dracut-cmdline.service" - echo "Before=dracut-initqueue.service" + echo "DefaultDependencies=no" + echo "Conflicts=shutdown.target" + echo "Before=shutdown.target" ) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" - # The iscsi deamon does not need to wait for any storage inside initrd mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.socket.d" ( echo "[Unit]" @@ -257,6 +250,15 @@ install() { echo "Conflicts=shutdown.target" echo "Before=shutdown.target sockets.target" ) > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf" + + mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.service.d" + ( + echo "[Unit]" + echo "DefaultDependencies=no" + echo "Conflicts=shutdown.target" + echo "Before=shutdown.target" + ) > "${initdir}/$systemdsystemunitdir/iscsiuio.service.d/dracut.conf" + mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d" ( echo "[Unit]"