Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2026 15:06:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        doc@FreeBSD.org
Subject:   [Bug 296130] rc.d/zfskeys blocks boot on keylocation=prompt datasets
Message-ID:  <bug-296130-9-4hnOgeG8Np@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-296130-9@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296130

--- Comment #10 from Doug Ambrisko <ambrisko@FreeBSD.org> ---
I can put this up for review
diff --git a/libexec/rc/rc.d/zfskeys b/libexec/rc/rc.d/zfskeys
index aff0224d5c9d..35f32b3baeb4 100755
--- a/libexec/rc/rc.d/zfskeys
+++ b/libexec/rc/rc.d/zfskeys
@@ -45,13 +45,14 @@ unlock_fs()
     local kl="$2"
     local k="${kl##file://}"

-    if [ "$kl" == "prompt" ]
-    then
-        echo "Key prompt for $fs."
-        if zfs load-key -L "$kl" "$fs" < /dev/tty > /dev/tty 2>/dev/tty ; then
-           echo "Key loaded for $fs."
-        else
-           echo "Key failed to load for $fs."
+    if [ "$kl" == "prompt" ]; then
+       if checkyesno zfskeys_prompt_enable ; then
+            echo "Key prompt for $fs."
+            if zfs load-key -L "$kl" "$fs" < /dev/tty > /dev/tty 2>/dev/tty ;
then
+               echo "Key loaded for $fs."
+            else
+               echo "Key failed to load for $fs."
+            fi
         fi
     elif [ "$k" ] && [ -f "$k" ] && [ -s "$k" ] && [ -r "$k" ]; then
         if [ "$(zfs get -Ho value keystatus "$fs")" = 'available' ]; then

I tested it with
  zfs_enable="YES"
  zfskeys_enable="YES"
  zfskeys_prompt_enable="YES"
/etc/rc.conf that worked for my case.  Without zfskeys_prompt_enable="YES" it
dropped into single user mode since it couldn't mount the needed file systems
for my boot.  Unless someone has zfskeys_prompt_enable="YES" then nothing
should change.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-296130-9-4hnOgeG8Np>