通行证│用户名: 密码: 验证码: 验证码,看不清楚?请点击刷新验证码 电信网通铁通移动   在线
资源搜索:
热门搜索:Linux VB C语言 PhotoShop Flash TCP/IP
   首页 | 文章 | 软件 | 动画 | 资源 | 励志 | 骗术 | 论坛 | 邮箱 | 会员中心 | 军事 | 科技 | 博客 | 图片 | 商城 | 最新更新 | 800g资源 | 爱心黑客
您现在的位置: 爱国者黑客 >> 资源 >> 操作系统 >> Solaris >> 系统管理 >> 文章正文
Solaris培训第六章:启动过程
责任编辑:黑色联想   更新日期:2006-9-7

启动有四个阶段

Boot PROM 阶段

Boot program 阶段

Kernel 初始化阶段

/sbin/init 阶段

启动过程:

自检、显示系统信息、读取启动设备的0扇区、在启动设备寻找启动程序、加载启动程序、启动内核、运行/sbin/init。

/sbin/init程序

读取/etc/inittab文件。Init程序执行/sbin/rc*脚本。

系统有多种运行级别,不同的运行级别所启动的服务不同。

系统运行级别有8种,分别为:

运行级别 意义

0 进入PROM状态(OK状态)

1 管理状态(所有文件系统都挂上的单用户模式,禁止其他用户登录)

2 多用户模式(没有网络文件共享服务

3 多用户模式(有网络文件共享服务

4 未使用

5 退出操作系统并关机

6 重新启动机器

S,s 单用户模式

who命令查看运行级别

# who -r

. run-level 3 5月 10 17:03 3 0 S

可得到的信息:当前运行级别是3,系统启动的时间是5月10日17:03.

/etc/inittabinittab定义了:

系统缺省运行级别

系统进入新运行级别需要做什么

/etc/init.d目录包含了系统的一些启动脚本

/etc/rc1.d目录包含进入运行级别1所需要运行的一些脚本

/etc/rc2.d目录包含进入运行级别2所需要运行的一些脚本

...

...

这些目录下包含两种文件:

以K打头,后面跟两个数字以及一些字符串:表示系统到这个运行级别时所需要停止的一些服务,系统将以stop调用这个脚本。

以S打头,后面跟两个数字以及一些字符串:表示系统到这个运行级别时所需要开始的一些服务,系统将以start调用这个脚本。

增加启动控制脚本

1.Identify the run level for the service

2.Determine which services are needed by the new process

3.Change to /etc/rc#.d and identify startup script

4.Repeat the process for the directory containing the shutdown script

5.create the startup (shutdown) script in /etc/init.d

6.create hard links to appropriate /etc/rc#.d directories

7.test

改变运行级别

init命令用于改变操作系统的运行级别。

命令格式:

init [ 0123456Ss ]

# init 0

INIT: New run level: 0

The system is coming down. Please wait.

System services are now being stopped.

Print services stopped.

Stopping the syslog service.

syslogd: going down on signal 15

Aug 14 14:54:30 snmpdx: received signal 15

The system is down.

syncing file systems... done

Program terminated

Type help for more information

ok

shutdown

用于改变操作系统运行级别。

命令格式:

shutdown [ -y ] [ -g seconds ] [ -i init-state ] [message]

选项:

y 系统提示时默认回答为YES

g 过多长时间改变

i 想要的运行级别

message 给所有登录用户的信息

# shutdown -y -g 0 -i 0

Shutdown started. Mon Dec 15 15:13:57 PST 1997

Broadcast Message from root (console) on mcmurdo Mon Dec

15 15:13:57...

THE SYSTEM IS BEING SHUT DOWN NOW ! ! !

Log off now or risk your files being damaged

Changing to init state 0 - please wait

ok

halt

  • 上一篇文章:
  • 下一篇文章:
  • 热门文章
    Olldbg常见问题
    汇编语言的艺术(组合语言的艺术)--观
    汇编语言的艺术(组合语言的艺术)--准
    汇编语言的艺术(组合语言的艺术)--基
    汇编语言的艺术(组合语言的艺术)--基
    汇编语言---程式设计 (4)
    虚拟8086模式
    SYS命令使用说明
    javascript + CSS 实现动态菜单显
    推荐文章
    自制Windows XP SP2自动安装光盘
    SQLServer注入工具改进版 v1.02
    使用photoshop CS进行自然美肤
    Photoshop绘制诺基亚手机
    PHOTOSHOP制作秋日之梦
    PHOTOSHOP鼠绘名模王爱萍
    Photoshop制作晶莹飞溅的水珠
    教你用PHOTOSHOP做放大镜
    鼠绘美女及服装修画全过程