Skip to content

Commit a93968b

Browse files
mwilckjohannbg
authored andcommitted
fix(nvmf): avoid calling "exit" in a cmdline hook
"exit" should never be executed in dracut hooks, because the hooks are sourced by the main script.
1 parent 556ef46 commit a93968b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules.d/95nvmf/parse-nvmf-boot-connections.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ for d in $(getargs rd.nvmf.discover -d nvmf.discover=); do
101101
done
102102

103103
# Host NQN and host id are mandatory for NVMe-oF
104-
[ -f "/etc/nvme/hostnqn" ] || exit 0
105-
[ -f "/etc/nvme/hostid" ] || exit 0
104+
if [ -f "/etc/nvme/hostnqn" ] && [ -f "/etc/nvme/hostid" ]; then
106105

107-
# If no nvme command line arguments present, try autodiscovery
108-
if [ $NVMF_FC_AUTO ] || [ ! -f "/etc/nvme/discovery.conf" ]; then
109-
/sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh
110-
else
111-
/sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
106+
# If no nvme command line arguments present, try autodiscovery
107+
if [ $NVMF_FC_AUTO ] || [ ! -f "/etc/nvme/discovery.conf" ]; then
108+
/sbin/initqueue --settled --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh
109+
else
110+
/sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
111+
fi
112112
fi

0 commit comments

Comments
 (0)