summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/initpkg/umountall.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/usr/src/cmd/initpkg/umountall.sh b/usr/src/cmd/initpkg/umountall.sh
index 98fcbe72e6..e2b19f2b45 100644
--- a/usr/src/cmd/initpkg/umountall.sh
+++ b/usr/src/cmd/initpkg/umountall.sh
@@ -20,7 +20,7 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -68,11 +68,15 @@ MNTTAB=/etc/mnttab
# /usr/bin/sleep -k, to sleep after an fuser -c -k on the mountpoint
# /usr/sbin/fuser -k, to kill processes keeping a mount point busy
#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# In addition, we use /usr/bin/tail if it is available; if not we use
# slower shell constructs to reverse a file.
PATH=/sbin:/usr/sbin:/usr/bin
+DEFERRED_ACTIVATION_PATCH_FLAG="/var/run/.patch_loopback_mode"
+SVC_STARTD="/lib/svc/bin/svc.startd"
+
# Clear these in case they were already set in our inherited environment.
FSType=
FFLAG=
@@ -173,6 +177,25 @@ if [ -z "${RFLAG}${NFLAG}${HFLAG}${FSType}" -a "$ZONENAME" = "global" -a \
/sbin/bootadm -a update_all
fi
+
+#
+# If we are in deferred activation patching, and the caller is
+# svc.startd, then exit without unmounting any of the remaining
+# file systems since the call path is from shutdown. Note that
+# by the time we get here, smf stop methods for nfs, cachefs
+# etc, will have run.
+#
+if [ -f $DEFERRED_ACTIVATION_PATCH_FLAG ] ; then
+ ppid=`ps -o ppid= -p $$` # parent of umountall will be sh
+ # from system()
+
+ ppid=`ps -o ppid= -p $ppid` # parent of sh will be svc.startd
+ COMM=`ps -o comm= -p $ppid`
+ if [ "$COMM" = "$SVC_STARTD" ] ; then
+ exit
+ fi
+fi
+
#
# Take advantage of parallel unmounting at this point if we have no
# criteria to match and we are in the global zone