zhouhuaiyi1014 发表于 2008-01-31 10:56

miletone


Troubeshooting:

做smf的试验时,执行了如下语句:#svcadm –v milestone –d multi-user-server:default
重启时总会提示信息:Booting to milestone "svc:/milestone/multi-user:default",
telnet localhost 总是拒绝,用svcx -vx 发现一大堆的服务都处于offline状态,
查看当前运行级别#who -r
.       run-level2Jul3 12:07   2   0S

如何才能将当前的系统再次引导到正常状态3下:
原来默认的里程碑全部都是指定all方式的话,系统中所有的服务都是启动的。 而如果milestone_FMRI 是下列之一时:
svc:/milestone/single-user:default
svc:/milestone/multi-user:default
svc:/milestone/multi-user-server:default
则所有的服务将临时禁用(除上面三种启动级别,另外两种是all 和none)

我们可以利用在启动系统的时候指定里程碑用-m参数
利用Stop + A 将系统切换到OK提示符下
Ok> boot –m milestone=all
重启时不再提示Booting to milestone "svc:/milestone/multi-user:default"
系统正常引导

为防止以后再出现这种情况后,进入系统后马上执行语句:
#svcadm -v milestone -d all

P.s:针对开篇第一句
svcadm milestone milestone -- 进入指定的服务里程碑,相当于进入相应的运行级别
执行语句前先明白该语句是用来做什么的,这里的-d指定一个milestone成为默认的milestone
参考英文资料如下:
milestone [-d] milestone_FMRI
If milestone_FMRI is the keyword “none”, all services other than the master restarter, svc:/system/svc/restarter:default, will be temporarily disabled.
If milestone_FMRI is the keyword “all”, temporary enable and disable requests for all services will be nullified.
If milestone_FMRI is one of the following:
svc:/milestone/single-user:default
svc:/milestone/multi-user:default
svc:/milestone/multi-user-server:defaultthen temporary enable and disable requests for the indicated service and all services it depends on (directly or indirectly) will be nullified. All other services will be temporarily disabled.
Changing the system's current milestone with the “milestone” subcommand will not change the current run level of the system. To change the system's run level, invoke /sbin/init directly.
This action requires permission to modify the “options_ovr” property group of the svc:/system/svc/restarter:default service instance (see
smf_security(5)
).
The -d option immediately changes the milestone to the requested milestone, as above. Additionally, it makes the specified milestone the default boot milestone, which persists across reboot. The default milestone is defined by the options/milestone property on the master restarter, svc:/system/svc/restarter:default. If this property is absent, “all” is the default. This action requires permission to modify the “options” property group of the svc:/system/svc/restarter:default service instance (see
smf_security(5)
).
更多资料详见:
http://docs.sun.com/app/docs/doc/816-5166/6mbb1kqid?l=zh_TW&a=view


顺便把Readme也贴上来,以方便日后查阅:
Copyright 2005 Sun Microsystems, Inc.All rights reserved.
Use is subject to license terms.
ident "@(#)README.share 1.2 05/09/01 SMI"
/lib/svc/share/README
smf(5):Notes on maintenance mode and recovery
Failures that bring the system to maintenance mode may include hardware
or critical software failures.The procedures below are given so that
some software repairs can be made; the recommended exit approach once a
repair has been made is to reboot the system.The system can be brought
to maintenance mode deliberately via the '-s' option to boot(1M), or via
the 's' option to init(1M).
In failure scenarios, smf(5) may or may not be running, depending on
which component has failed.If smf(5) is running, and the /usr
filesystem is reachable, then the usual svcadm(1M) invocations to clear
maintenance state and restart services instances can be used.
Otherwise, the following instructions describe the direct execution of
service methods, so that capabilities that svc.startd(1M) would normally
start automatically can be started manually.In the case that the
document recommends an invocation like
# /lib/svc/method/example-method start
you may also consider running these scripts with the shell displaying
the commands from the service method as they are executed.For sh(1)
based scripts, this would mean running the method as
# /sbin/sh -x /lib/svc/method/example-method start
Some methods may be written to instead use ksh(1), with invocation
# /usr/bin/ksh -x /lib/svc/method/example-method start
The first line of the service method script will generally specify its
required interpreter using the standard #! notation.Method scripts may
potentially require interpreters other than sh(1) or ksh(1).
1.Boot archive failure
Boot archive may become out of sync with the root filesystem in
a reboot following an abnormal system shutdown. The recommended
action is to reboot immediately, choose "Solaris failsafe" when
the boot menu is displayed. Type 'i' to get an interactive recovery
shell and follow instructions to update the boot archive.
If the list of stale files are not yet loaded by the kernel
or are compatible, you may continue booting by clearing the
boot-archive service state
# svcadm clear system/boot-archive
2.Failure to mount filesystems.
In cases where the system was unable to bring a combination of the
system/filesystem/{root,usr,minimal} services online, it may be possible
to directly execute the corresponding service methods
# /lib/svc/method/fs-root
# /lib/svc/method/fs-usr
# /lib/svc/method/fs-minimal
to mount the various filesystems.In the case that these methods fail,
a direct invocation of mount(1M), and potentially fsck(1M), should be
attempted for file systems required for recovery purposes.
/lib/svc/method/fs-usr attempts to remount the root file system
read-write, such that persistent changes can be made to the system's
configuration.If this method is failing, one can directly remount
using the mount(1M) command via
# /sbin/mount -o rw,remount /
/etc/svc/volatile is a temporary filesystem generally reserved for Sun
private use.It may prove a useful location to create mount points if
the root file system cannot be remounted read-write.
3.Failure to run svc.configd(1M).
svc.configd(1M) will give detailed instructions for recovery if the
corruption is detected in the repository.If svc.configd(1M) cannot be
run because of missing or corrupt library components, then the affected
components will need to be replaced.Components could be copied from a
CD-ROM or DVD-ROM, or from another system.
4.Failure to run svc.startd(1M).
If the inittab(4) line to invoke svc.startd(1M) is missing or incorrect,
it will need to be restored.A valid entry is
smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2/dev/msglog
If svc.startd(1M) cannot be run because of missing or corrupt library
components, then the affected components will need to be replaced, as
for svc.configd(1M) above.
5.Activating basic networking configuration.
If svc.startd(1M) did not execute successfully, it may also be necessary
to activate network interfaces manually, such that other hosts can be
contacted.The service methods can be invoked directly as
# /lib/svc/method/net-loopback
# /lib/svc/method/net-physical
If these methods fail, a direct invocation of ifconfig(1M) can be
attempted.
In some scenarios, one may be able to use routeadm(1M) to activate more
dynamic route management functionality; restoring the default dynamic
routing behaviour can be done using the '-u' option.(Invoking routeadm
with no arguments will display which commands must be accessible for the
current routing configuration to be invoked.)Otherwise, once
interfaces are up, a default route can be manually added using the
route(1M) command.On typical IPv4 networks, this invocation would be
# /sbin/route add net default _gateway_IP_
--
(An extended version of this document is available at


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/60639/showart_474130.html
页: [1]
查看完整版本: miletone