From ed9e8cc51215d909e26a319d4909e4af184814d1 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Wed, 2 Mar 2005 00:58:05 +0000 Subject: [PATCH] If we don't have /usr/sbin/mtree, try to mount /usr. We're only likely to hit this case when /usr is remote and thus hasn't been mounted (since you're supposed to have /var before mounting remote file systems). Normal machines that don't have a /var for some reason will have /usr already available because it's local. --- etc/rc.d/var | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/etc/rc.d/var b/etc/rc.d/var index af6bb9cfccfd..3eb21e21e401 100644 --- a/etc/rc.d/var +++ b/etc/rc.d/var @@ -83,10 +83,19 @@ case "${populate_var}" in *) if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then true - elif [ ! -x /usr/sbin/mtree ] ; then - false - else + elif [ -x /usr/sbin/mtree ] ; then _populate_var + else + # We need mtree to populate /var so try mounting /usr. + # If this does not work, we can not boot so it is OK to + # try to mount out of order. + mount /usr + if [ ! -x /usr/sbin/mtree ] ; then + exit 1 + else + _populate_var + fi + else fi ;; esac