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

            Bug ID: 289632
           Summary: zpool import fails on multi-user boot
           Product: Base System
           Version: 14.3-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: [email protected]
          Reporter: [email protected]

In /etc/rc.d/zpool, zpool import is called as follows:

zpool_start()
{
        local cachefile

        for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do
                if [ -r $cachefile ]; then
                        zpool import -c $cachefile -a -N
                        if [ $? -ne 0 ]; then
                                echo "Import of zpool cache ${cachefile}
failed,
" \
                                    "will retry after root mount hold release"
                                root_hold_wait
                                zpool import -c $cachefile -a -N
                        fi
                        break
                fi
        done
}

If devices called out in zpool.cache are not available during the first zpool
import above, zpool will emit an error message but will return an exit status
of 0 anyway.  Therefore, root_hold_wait (from /etc/rc.subr) will not be called,
and the "second chance" zpool import is not run.

It is possible that /sbin/zpool needs to be modified to return nonzero on all
errors, but what I ended up doing was this in /etc/rc.d/zpool:

zpool_start()
{
        local cachefile impnews

        for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do
                if [ -r $cachefile ]; then
                        impnews=$(zpool import -c $cachefile -a -N 2>&1)
                        if [ $? -ne 0 -o -n "$impnews" ]; then
                                echo "Import of zpool cache ${cachefile}
failed,
" \
                                    "will retry after root mount hold release"
                                root_hold_wait
                                zpool import -c $cachefile -a -N
                        fi
                        break
                fi
        done
}

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

Reply via email to