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