diff --git a/libexec/rc/rc.d/dumpon b/libexec/rc/rc.d/dumpon index dddbf2af01cc..752f52315f49 100755 --- a/libexec/rc/rc.d/dumpon +++ b/libexec/rc/rc.d/dumpon @@ -1,77 +1,79 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: dumpon # BEFORE: disks # KEYWORD: nojail . /etc/rc.subr name="dumpon" desc="Dump kernel corefiles from swap to disk" start_cmd="dumpon_start" stop_cmd="dumpon_stop" dumpon_try() { local flags flags=${dumpon_flags} if [ -n "${dumppubkey}" ]; then warn "The dumppubkey variable is deprecated. Use dumpon_flags." flags="${flags} -k ${dumppubkey}" fi /sbin/dumpon ${flags} "${1}" if [ $? -eq 0 ]; then # Make a symlink in devfs for savecore ln -fs "${1}" /dev/dumpdev return 0 fi warn "unable to specify $1 as a dump device" return 1 } dumpon_start() { # Enable dumpdev so that savecore can see it. Enable it # early so a crash early in the boot process can be caught. # case ${dumpdev} in [Nn][Oo] | '') ;; [Aa][Uu][Tt][Oo]) + root_hold_wait dev=$(/bin/kenv -q dumpdev) if [ -n "${dev}" ] ; then dumpon_try "${dev}" return $? fi while read dev mp type more ; do [ "${type}" = "swap" ] || continue [ -c "${dev}" ] || continue dumpon_try "${dev}" 2>/dev/null && return 0 done &2 return 1 ;; *) + root_hold_wait dumpon_try "${dumpdev}" ;; esac } dumpon_stop() { case ${dumpdev} in [Nn][Oo] | '') ;; *) rm -f /dev/dumpdev /sbin/dumpon -v off ;; esac } load_rc_config $name run_rc_command "$1" diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool index f98693f2cb13..e73c2b7e5b73 100755 --- a/libexec/rc/rc.d/zpool +++ b/libexec/rc/rc.d/zpool @@ -1,31 +1,38 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: zpool # REQUIRE: hostid disks # BEFORE: mountcritlocal # KEYWORD: nojail . /etc/rc.subr name="zpool" desc="Import ZPOOLs" rcvar="zfs_enable" start_cmd="zpool_start" required_modules="zfs" 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 && break + 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 } load_rc_config $name run_rc_command "$1"