fs-local revision 7c478bd95313f5f23a4c958a745db2134aa03244
0N/A#!/sbin/sh
0N/A#
0N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License, Version 1.0 only
0N/A# (the "License"). You may not use this file except in compliance
0N/A# with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
873N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
0N/A#
0N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
868N/A# Use is subject to license terms.
0N/A#
338N/A#ident "%Z%%M% %I% %E% SMI"
0N/A
0N/A. /lib/svc/share/smf_include.sh
0N/A
0N/A# Mount all local filesystems.
0N/A
0N/Acd /; /sbin/mountall -l >/dev/msglog
0N/Arc=$?
0N/Aif [ $rc -ne 0 ]; then
1113N/A msg="WARNING: /sbin/mountall -l failed: exit status $rc"
1400N/A echo $msg
1113N/A echo "$SMF_FMRI:" $msg >/dev/msglog
0N/A exit $SMF_EXIT_ERR_FATAL
0N/Afi
0N/A
0N/A# get rid of transient reboot entry in GRUB menu
0N/Aif [ -f /stubboot/boot/grub/menu.lst ]; then
338N/A /sbin/bootadm -m update_temp -R /stubboot
338N/Aelse
338N/A /sbin/bootadm -m update_temp
338N/Afi
0N/A
0N/A#
0N/A# If there are non-global UFS filesystems with quotas, check and enable them.
1113N/A#
1400N/A
1400N/A# vlist is the non-global filesystems in vfstab requesting quotas
1400N/Avlist=`/usr/bin/nawk '$1 !~ /^(#|-)/ && $4 == "ufs" {
1400N/A if (match($7, "(^|,)(quota|rq)(,|$)") != 0 &&
1400N/A match($7, "(^|,)global(,|$)") == 0) print $1; }' /etc/vfstab`
1113N/A
1113N/Aif [ -n "$vlist" ]; then
1113N/A # mlist is the filesystems in mnttab that are ufs, mounted rw,
0N/A # and without quotas turned on
0N/A mlist=`/usr/sbin/mount -p | /usr/bin/nawk '$4 == "ufs" {
0N/A if (match($7, "(^|,)ro(,|$)") == 0) print $1; }'`
0N/A
1113N/A # qlist is the intersection of vlist and mlist
0N/A qlist=`echo "$vlist\n-\n$mlist" | \
1113N/A /usr/bin/nawk '{if ($1 == "-") { mlist = 1; }
0N/A else if (mlist == 0) { vlist[$1] = 1; }
0N/A else if (vlist[$1]) { print $1; } }'`
0N/A
0N/A #
1113N/A # Just check and enable the non-global UFS file systems with quotas
0N/A # enabled. Note that "quotacheck -a" and "quotaon -a" will try
1113N/A # to process all UFS entries with quotas rather than excluding
0N/A # the entries with the global option (the global entries are handled
0N/A # later in another script if the cluster package is installed).
0N/A #
0N/A if [ -n "$qlist" ]; then
338N/A echo 'Checking UFS quotas: \c'
338N/A /usr/sbin/quotacheck -p $qlist
0N/A echo 'done.'
0N/A /usr/sbin/quotaon $qlist
0N/A fi
0N/Afi
0N/A
0N/Aexit $SMF_EXIT_OK
1113N/A