xref: /titanic_50/usr/src/cmd/svc/milestone/README.share (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23Use is subject to license terms.
24
25ident	"%Z%%M%	%I%	%E% SMI"
26
27/lib/svc/share/README
28
29smf(5):  Notes on maintenance mode and recovery
30
31Failures that bring the system to maintenance mode may include hardware
32or critical software failures.  The procedures below are given so that
33some software repairs can be made; the recommended exit approach once a
34repair has been made is to reboot the system.  The system can be brought
35to maintenance mode deliberately via the '-s' option to boot(1M), or via
36the 's' option to init(1M).
37
38In failure scenarios, smf(5) may or may not be running, depending on
39which component has failed.  If smf(5) is running, and the /usr
40filesystem is reachable, then the usual svcadm(1M) invocations to clear
41maintenance state and restart services instances can be used.
42Otherwise, the following instructions describe the direct execution of
43service methods, so that capabilities that svc.startd(1M) would normally
44start automatically can be started manually.  In the case that the
45document recommends an invocation like
46
47# /lib/svc/method/example-method start
48
49you may also consider running these scripts with the shell displaying
50the commands from the service method as they are executed.  For sh(1)
51based scripts, this would mean running the method as
52
53# /sbin/sh -x /lib/svc/method/example-method start
54
55Some methods may be written to instead use ksh(1), with invocation
56
57# /usr/bin/ksh -x /lib/svc/method/example-method start
58
59The first line of the service method script will generally specify its
60required interpreter using the standard #! notation.  Method scripts may
61potentially require interpreters other than sh(1) or ksh(1).
62
631.  Boot archive failure
64
65The boot archive may become out of sync with the root filesystem in a
66reboot following an abnormal system shutdown. The recommended action is
67to reboot immediately to rebuild the archive and correct the inconsistency.
68To accomplish this, on a GRUB-based platform, choose "Solaris failsafe"
69when the boot menu is displayed.  Type 'i' to get an interactive recovery
70shell and follow instructions to update the boot archive.  On an OBP-
71based platform, type 'boot -F failsafe' and follow the instructions.
72
73If the list of stale files are not yet loaded by the kernel
74or are compatible, you may continue booting by clearing the
75boot-archive service state
76
77# svcadm clear system/boot-archive
78
792.  Failure to mount filesystems.
80
81In cases where the system was unable to bring a combination of the
82system/filesystem/{root,usr,minimal} services online, it may be possible
83to directly execute the corresponding service methods
84
85# /lib/svc/method/fs-root
86# /lib/svc/method/fs-usr
87# /lib/svc/method/fs-minimal
88
89to mount the various filesystems.  In the case that these methods fail,
90a direct invocation of mount(1M), and potentially fsck(1M), should be
91attempted for file systems required for recovery purposes.
92
93/lib/svc/method/fs-usr attempts to remount the root file system
94read-write, such that persistent changes can be made to the system's
95configuration.  If this method is failing, one can directly remount
96using the mount(1M) command via
97
98# /sbin/mount -o rw,remount /
99
100/etc/svc/volatile is a temporary filesystem generally reserved for Sun
101private use.  It may prove a useful location to create mount points if
102the root file system cannot be remounted read-write.
103
1043.  Failure to run svc.configd(1M).
105
106svc.configd(1M) will give detailed instructions for recovery if the
107corruption is detected in the repository.  If svc.configd(1M) cannot be
108run because of missing or corrupt library components, then the affected
109components will need to be replaced.  Components could be copied from a
110CD-ROM or DVD-ROM, or from another system.
111
1124.  Failure to run svc.startd(1M).
113
114If the inittab(4) line to invoke svc.startd(1M) is missing or incorrect,
115it will need to be restored.  A valid entry is
116
117smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog </dev/console
118
119If svc.startd(1M) cannot be run because of missing or corrupt library
120components, then the affected components will need to be replaced, as
121for svc.configd(1M) above.
122
1235.  Activating basic networking configuration.
124
125If svc.startd(1M) did not execute successfully, it may also be necessary
126to activate network interfaces manually, such that other hosts can be
127contacted.  The service methods can be invoked directly as
128
129# /lib/svc/method/net-loopback
130# /lib/svc/method/net-physical
131
132If these methods fail, a direct invocation of ifconfig(1M) can be
133attempted.
134
135In some scenarios, one may be able to use routeadm(1M) to activate more
136dynamic route management functionality; restoring the default dynamic
137routing behaviour can be done using the '-u' option.  (Invoking routeadm
138with no arguments will display which commands must be accessible for the
139current routing configuration to be invoked.)  Otherwise, once
140interfaces are up, a default route can be manually added using the
141route(1M) command.  On typical IPv4 networks, this invocation would be
142
143# /sbin/route add net default _gateway_IP_
144
145--
146
147(An extended version of this document is available at
148http://sun.com/msg/SMF-8000-QD.  That version includes additional
149document references.)
150