7712 mandoc -Tlint does always exit with error code 0
[unleashed.git] / usr / src / cmd / lvm / util / svc-metainit
blob12536428e8696e3c6f1d701808d3d0abbecbeca7
1 #!/sbin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # CDDL HEADER END
24 #pragma ident "%Z%%M% %I% %E% SMI"
26 # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
27 # Use is subject to license terms.
29 # Metadisk initialization.
31 METAINIT=/sbin/metainit
32 METADEV=/dev/md/admin
34 . /lib/svc/share/smf_include.sh
36 if [ ! -s /kernel/drv/md.conf ]; then
37 echo "/kernel/drv/md.conf is missing or empty."
38 exit 0
41 if [ ! -c $METADEV ]; then
42 echo "$METADEV is missing or not a character device."
43 exit 0
46 $METAINIT -r
47 error=$?
48 case "$error" in
49 0|1) exit 0
52 66)
53 echo "Insufficient metadevice database replicas located."
54 echo
55 echo "Use metadb to delete databases which are broken."
56 echo "Ignore any "Read-only file system" error messages."
57 echo "Reboot the system when finished to reload the metadevice database."
58 echo "After reboot, repair any broken database replicas which were deleted."
60 echo "Insufficient metadevice database replicas located." >/dev/console
61 echo >/dev/console
62 echo "Use metadb to delete databases which are broken." >/dev/console
63 echo "Ignore any "Read-only file system" error messages." >/dev/console
64 echo "Reboot the system when finished to reload the metadevice database." \
65 >/dev/console
66 echo "After reboot, repair any broken database replicas which were deleted." \
67 >/dev/console
69 exit $SMF_EXIT_ERR_CONFIG
72 *) echo "Unknown $METAINIT -r failure $error."
73 exit 1
75 esac