`
ihuashao
  • 浏览: 4552885 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

Solaris启动过程详解

阅读更多
引导
在Sparc平台下,Solaris<clk>系统中有一个类似PC BIOS的芯片<nobr id="clickeyekey2" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,2)" oncontextmenu="return false" onmouseover="kwE(event,2, this)" onmouseout="kwL(event,this)" onmousemove="kwM(2)">程序</nobr>(EEPROM OpenBoot)负责识别分区、文 </clk>
件系统和加载内核,在Solaris 2.6之后的版本中,默认的内核文件存放在/platform/`arch`/kernel/unix
<!-- google_ad_client = "pub-1572879403720716"; google_ad_width = 300; google_ad_height = 250; google_ad_format = "300x250_as"; google_ad_type = "text_image"; google_ad_channel ="0168087865"; google_alternate_ad_url ="http://www.qqread.com/0000js/google300.htm"; google_color_border = "F9FCFE"; google_color_bg = "F9FCFE"; google_color_link = "1F3A87"; google_color_url = "FF6666"; google_color_text = "000000" google_language = 'zh-CN'; //--> <iframe name="google_ads_frame" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-1572879403720716&amp;dt=1217554143708&amp;hl=zh-CN&amp;lmt=1200307598&amp;alternate_ad_url=http%3A%2F%2Fwww.qqread.com%2F0000js%2Fgoogle300.htm&amp;format=300x250_as&amp;output=html&amp;correlator=1217554143692&amp;channel=0168087865&amp;url=http%3A%2F%2Fwww.qqread.com%2Fnetwork%2Fserver%2Ff228312.html&amp;color_bg=F9FCFE&amp;color_text=000000&amp;color_link=1F3A87&amp;color_url=FF6666&amp;color_border=F9FCFE&amp;ad_type=text_image&amp;ref=http%3A%2F%2Fwww.google.com%2Fsearch%3Fhl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla%253Aen-US%253Aofficial%26hs%3DOgO%26q%3Dsolaris%2Binit.d%2B%25E5%2590%25AF%25E5%258A%25A8%26btnG%3DSearch&amp;frm=0&amp;cc=100&amp;ga_vid=1113833019612183900.1217554144&amp;ga_sid=1217554144&amp;ga_hid=142679596&amp;flash=9.0.124&amp;u_h=1024&amp;u_w=1280&amp;u_ah=971&amp;u_aw=1280&amp;u_cd=32&amp;u_tz=480&amp;u_his=1&amp;u_java=true&amp;u_nplug=16&amp;u_nmime=55" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="250" scrolling="no" width="300"></iframe>
<clk>位置,`arch`指令是指明系统的硬件体系,<nobr id="clickeyekey1" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,1)" oncontextmenu="return false" onmouseover="kwE(event,1, this)" onmouseout="kwL(event,this)" onmousemove="kwM(1)">目前</nobr>一般是i86pc(Intel IA32)或sun4u(Sun UntraSparc)。 </clk>

在Intel体系中,因为没有eeprom firmware,所以系统提供了一个模拟eeprom的引导程序,来负责
<clk>内核的定位和加载,这个程序是<nobr id="clickeyekey5" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,5)" oncontextmenu="return false" onmouseover="kwE(event,5, this)" onmouseout="kwL(event,this)" onmousemove="kwM(5)">工作</nobr>在实模式下的,系统必须要给他提供一个fat12/16格式的boot分区, </clk>
在系统引导完成之后可以在/boot/solaris下找到他的配置文件。(Solaris IA使用默认内核/kernel/unix)

整个系统启动过程如下:
===========================================================================
init 0 openboot模式 -> (引导内核,加载硬件驱动) 可以选择从cdrom引导进入维护模式
|
V
init 1 单用户模式 -> (加载/分区) 登陆进入维护模式,或按Ctrl+D进入多用户模式
|
V
<clk>init 2 网络工作站模式 -&gt; (连接网络,运行网络工作站<nobr id="clickeyekey3" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,3)" oncontextmenu="return false" onmouseover="kwE(event,3, this)" onmouseout="kwL(event,this)" onmousemove="kwM(3)">服务</nobr>) 运行/etc/rc2脚本连接网络 </clk>
| |
<clk>| -&gt;-&gt; 启动S69inet服务,运行部分inetd<nobr id="clickeyekey6" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,6)" oncontextmenu="return false" onmouseover="kwE(event,6, this)" onmouseout="kwL(event,this)" onmousemove="kwM(6)">网络</nobr>服务 </clk>
V
init 3 网络服务器模式 -> (运行各种网络服务) 运行/etc/rc3脚本启动网络服务器




<2>启动
Solaris的启动进程是按照SYS V格式控制的,启动过程分为若干个运行级别(S,1-6),当系统内核
运行完毕,加载好所有的驱动之后,就会把控制权移交给/sbin/init进程(PID:1),也就是所有进
程的父进程,然后由init读取/etc/inittab,依次执行/etc/rc1(2,3)启动脚本,最终到达inittab
中指定的默认运行级别。rc脚本会读取/etc/rc*.d中的启动脚本,启动脚本以大写字母S开头,在rc
运行期间就会被执行,S后面的两位数字域决定启动顺序,因为启动进程之间有一定的依赖关系 (以K
开头意味着进入这个级别时,服务将会被杀掉,其余字母开头的被忽略)。

<clk>虽然同属于SYSV系统引导方式,但是Solaris的引导过程和<nobr id="clickeyekey0" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,0)" oncontextmenu="return false" onmouseover="kwE(event,0, this)" onmouseout="kwL(event,this)" onmousemove="kwM(0)">我们</nobr>常见的</clk>Linux却有很大差别,并且和
传统Unix的init级别也略有不同。在Linux中,系统运行级别是并行式的,也就是系统加载完内核和
mount /文件系统之后,就会直接跳转到相应的默认运行级别,而不依次执行各个级别的启动脚本。但
在Solaris中,采取了一种串行化的引导方式,就是依次执行init 1/2/3,直到默认运行级别,在每
个级别中的所有启动脚本都会被执行。所以在这里我以一种和传统Unix划分方式不同的说明方法,
把Solaris的启动级别称为: 1,单用户模式 2,网络工作站模式 3,网络服务器模式

下面是/etc中所有的启动运行脚本简要说明
===========================================================================
init inittab rc0 rc1 rc2 rc3 rc5 rc6 rcS init.d
init 系统启动超级进程
inittab 进程启动配置文件
rc0 - rc6 各启动级别的启动脚本
rcS 单用户模式启动脚本
init.d 启动脚本存放目录


rc0.d: eeprom OpenBoot状态,可以进入硬件维护模式,或关闭机器。


rc1.d: 单用户模式,可以对系统进行软件维护。
S01MOUNTFSYS +加载文件系统
S10lu =当运行live update后清理系统


rc2.d: 多用户模式,启动网络工作站服务。 (最后会启动dtlogin允许图形界面工作站)
S01MOUNTFSYS
S05RMTMPFILES + 清空/tmp文件系统
/tmp是系统缓存文件目录,和swap分区共享空间,如果分区满的话会
对系统性能造成很大影响

S10lu =

S20sysetup + 设置系统初始参数

设置hostname等
S21perf = 性能记账服务(无效)
开启accton记账服务,默认无效

S30sysid.net + 配置基本网络参数
设置系统ip地址

S40llc2 + 启动Class II logical link control driver
逻辑链路控制程序驱动

S42ncakmod = 启动Solaris Network Cache and Accelerator (NCA)
<clk>NCA网络缓存加速驱动,可以<nobr id="clickeyekey7" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,7)" oncontextmenu="return false" onmouseover="kwE(event,7, this)" onmouseout="kwL(event,this)" onmousemove="kwM(7)">提高</nobr>HTTP </clk>Server吞吐率

S47pppd - 启动拨号访问服务器进程
串行线拨号访问服务器

S69inet = 启动inetd进程
Internet服务超级进程,配置文件/etc/inetd.conf,启动一系列
服务,如telnet/ftp等

s70uucp - 启动uucp
uucp服务,无用

S71rpc + 启动rpcbind服务
rpcbind (RPC Portmap服务),如果需要CDE的话,这个进程是必需的

S71sysid.sys + 配置一些系统参数

S71ldap.client - 启动LDAP客户端

S72directory - 启动目录服务

S72inetsvc + 启动inet server,包含named/nis

启动名字解析服务,包含named和nis两部分

s72slpd - 启动slpd
打印服务系统的一部分

S72autoinstall = 启动自动安装守护进程
当放入sun兼容的媒体介质时,会自动启动安装脚本

S73cachefs.daemon - 启动cachefsd
NFS缓存服务,可以提高NFS吞吐率

S73nfs.client = 启动nfs客户端
NFS客户端程序

S74syslog + 启动syslog
系统日志守护进程,必需

s74autofs - 启动auto mount fsd
当使用NFS时,这个进程会自动加载或卸载无用的用户网络文件系统
配置文件/etc/auto_home和auto_master
但是当没有使用nfs时,这个进程会对系统管理造成一些负面影响

s74xntpd - 启动网络时间同步服务

S75cron + 启动crontab服务
系统任务自动调度守护进程

S75savecore +

S76nscd + 启动nscd,名字服务缓存
DNS名字缓存服务

S80kdmconfig = 启动kdmconfig
如果系统启动时X-Window配置文件丢失,这个进程会启动X-Window配置

S80spc - 启动lpd打印守护进程
打印服务系统的一部分

s80lp - 启动lpd打印调度守护进程
打印服务系统的一部分

S85lmgrd + 启动flexlm license服务器
<clk>Solaris License<nobr id="clickeyekey4" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,4)" oncontextmenu="return false" onmouseover="kwE(event,4, this)" onmouseout="kwL(event,this)" onmousemove="kwM(4)">管理</nobr>服务器 </clk>

S85power + 启动电源守护进程

S88utmpd + 启动utmpd

s88sendmail - 启动sendmail

S89PRESERVE =
保留,无效

S90wbem = 启动wbem,基于web的管理界面
WBEM,Solaris系统管理界面服务器,可以使用/usr/sadm/bin/smc
启动客户端程序连接管理

S93cacheos.finish -

S94ncalogd = 启动Solaris Network Cache and Accelerator LOGd
NCA进程日志

S95IIim + 启动输入法守护进程
Solaris国际化支持的一部分,启动东亚语言输入法

S95svm.sync + 启动 devfsadm ,devfs同步进程
监控系统硬件,使/dev与/devices设备文件同步

<clk>S99audit + 启动BSM<nobr id="clickeyekey8" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,8)" oncontextmenu="return false" onmouseover="kwE(event,8, this)" onmouseout="kwL(event,this)" onmousemove="kwM(8)">审计</nobr>进程 </clk>
Solaris Base Securiey Modula,启动Solaris C2安全审计
默认未启动

S99dtlogin = 启动CDE登录进程
Solaris CDE图形界面启动进程


rc3.d: 多用户模式,启动网络服务器模式
S15nfs.server - 启动nfs服务器
NFS网络文件服务器

S13kdc.master - 启动Kerberos服务器
S14kdc - 启动Kerberos服务器
Kerberos认证服务器

S16boot.server - 启动bootp服务器
boot网络启动服务

S34dhcp = 启动dhcp
DHCP服务器

S50apache - 启动apache服务器

S76snmpdx - 启动snmp服务器
<clk>启动SNMP服务,允许<nobr id="clickeyekey9" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" onclick="kwC(event,9)" oncontextmenu="return false" onmouseover="kwE(event,9, this)" onmouseout="kwL(event,this)" onmousemove="kwM(9)">远程</nobr></clk>网络管理

S77dmi - 启动snmp - dmi服务
SNMP子服务

S89sshd + 启动sshd服务器
SSH服务器

S80mipagent - 启动Mobile IP 代理
S90samba - 启动samba服务器
Samba CIFS网络文件服务器


*在上面的启动脚本说明中,第二个域说明服务的必要性,个人的经验总结。
+代表必须服务,系统正常运行必须
=代表可选服务,由用户环境决定
-代表无效,不必要,或不安全的服务


<3>进程
下面是系统启动后的默认进程情况,因为Solaris是一个系统环境相对较稳定的系统,所以每次启动
之后,系统的基本进程和服务情况应该都差不多的,下面是常见的进程和服务说明。
===========================================================================
# ps -el
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
19 T 0 0 0 0 0 SY fec287cc 0 ? 0:01 + sched
*系统进程调度
8 S 0 1 0 0 40 20 de7a9808 319 de95ce16 ? 0:00 + init
*init进程
19 S 0 2 0 0 0 SY de7a9108 0 fec4d4b8 ? 0:00 + pageout
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics