Skip to content

Commit

Permalink
fix(nvmf): avoid calling "exit" in a cmdline hook
Browse files Browse the repository at this point in the history
"exit" should never be executed in dracut hooks, because the
hooks are sourced by the main script.
  • Loading branch information
mwilck authored and johannbg committed Sep 30, 2022
1 parent 556ef46 commit a93968b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules.d/95nvmf/parse-nvmf-boot-connections.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ for d in $(getargs rd.nvmf.discover -d nvmf.discover=); do
done

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

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

0 comments on commit a93968b

Please sign in to comment.