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