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.
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.
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]
22 Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 Use is subject to license terms.
27 smf(5): Notes on maintenance mode and recovery
29 Failures that bring the system to maintenance mode may include hardware
30 or critical software failures. The procedures below are given so that
31 some software repairs can be made; the recommended exit approach once a
32 repair has been made is to reboot the system. The system can be brought
33 to maintenance mode deliberately via the '-s' option to boot(1M), or via
34 the 's' option to init(1M).
36 In failure scenarios, smf(5) may or may not be running, depending on
37 which component has failed. If smf(5) is running, and the /usr
38 filesystem is reachable, then the usual svcadm(1M) invocations to clear
39 maintenance state and restart services instances can be used.
40 Otherwise, the following instructions describe the direct execution of
41 service methods, so that capabilities that svc.startd(1M) would normally
42 start automatically can be started manually. In the case that the
43 document recommends an invocation like
45 # /lib/svc/method/example-method start
47 you may also consider running these scripts with the shell displaying
48 the commands from the service method as they are executed. For sh(1)
49 based scripts, this would mean running the method as
51 # /sbin/sh -x /lib/svc/method/example-method start
53 Some methods may be written to instead use ksh(1), with invocation
55 # /usr/bin/ksh -x /lib/svc/method/example-method start
57 The first line of the service method script will generally specify its
58 required interpreter using the standard #! notation. Method scripts may
59 potentially require interpreters other than sh(1) or ksh(1).
61 1. Boot archive failure
63 The boot archive may become out of sync with the root filesystem in a
64 reboot following an abnormal system shutdown. The recommended action is
65 to reboot immediately to rebuild the archive and correct the inconsistency.
66 To accomplish this, on a GRUB-based platform, choose "Solaris failsafe"
67 when the boot menu is displayed. Type 'i' to get an interactive recovery
68 shell and follow instructions to update the boot archive. On an OBP-
69 based platform, type 'boot -F failsafe' and follow the instructions.
71 If the list of stale files are not yet loaded by the kernel
72 or are compatible, you may continue booting by clearing the
73 boot-archive service state
75 # svcadm clear system/boot-archive
77 2. Failure to mount filesystems.
79 In cases where the system was unable to bring a combination of the
80 system/filesystem/{root,usr,minimal} services online, it may be possible
81 to directly execute the corresponding service methods
83 # /lib/svc/method/fs-root
84 # /lib/svc/method/fs-usr
85 # /lib/svc/method/fs-minimal
87 to mount the various filesystems. In the case that these methods fail,
88 a direct invocation of mount(1M), and potentially fsck(1M), should be
89 attempted for file systems required for recovery purposes.
91 /lib/svc/method/fs-usr attempts to remount the root file system
92 read-write, such that persistent changes can be made to the system's
93 configuration. If this method is failing, one can directly remount
94 using the mount(1M) command via
96 # /sbin/mount -o rw,remount /
98 /etc/svc/volatile is a temporary filesystem generally reserved for Sun
99 private use. It may prove a useful location to create mount points if
100 the root file system cannot be remounted read-write.
102 3. Failure to run svc.configd(1M).
104 svc.configd(1M) will give detailed instructions for recovery if the
105 corruption is detected in the repository. If svc.configd(1M) cannot be
106 run because of missing or corrupt library components, then the affected
107 components will need to be replaced. Components could be copied from a
108 CD-ROM or DVD-ROM, or from another system.
110 4. Failure to run svc.startd(1M).
112 If the inittab(4) line to invoke svc.startd(1M) is missing or incorrect,
113 it will need to be restored. A valid entry is
115 smf::sysinit:/lib/svc/bin/svc.startd >/dev/msglog 2<>/dev/msglog </dev/console
117 If svc.startd(1M) cannot be run because of missing or corrupt library
118 components, then the affected components will need to be replaced, as
119 for svc.configd(1M) above.
121 5. Activating basic networking configuration.
123 If svc.startd(1M) did not execute successfully, it may also be necessary
124 to activate network interfaces manually, such that other hosts can be
125 contacted. The service methods can be invoked directly as
127 # /lib/svc/method/net-loopback
128 # /lib/svc/method/net-physical
130 If these methods fail, a direct invocation of ifconfig(1M) can be
133 In some scenarios, one may be able to use routeadm(1M) to activate more
134 dynamic route management functionality; restoring the default dynamic
135 routing behaviour can be done using the '-u' option. (Invoking routeadm
136 with no arguments will display which commands must be accessible for the
137 current routing configuration to be invoked.) Otherwise, once
138 interfaces are up, a default route can be manually added using the
139 route(1M) command. On typical IPv4 networks, this invocation would be
141 # /sbin/route add net default _gateway_IP_
145 (An extended version of this document is available at
146 http://illumos.org/msg/SMF-8000-QD. That version includes additional
147 document references.)