TIP Speed up your boot time
出自Gentoo Linux Wiki
| 终端/Shell • 网络 • X 窗口系统 • Portage • 系统 • 文件系统 • 内核 • 其它 |
目录 |
[编辑] RC 文件
编辑 /etc/conf.d/rc:
| 文件: /etc/conf.d/rc |
|
将 RC_PARALLEL_STARTUP="NO" 改成 RC_PARALLEL_STARTUP="YES" |
注释: 到 sys-apps/baselayout-1.12.20_pre3-r2, RC_PARALLEL_STARTUP 去掉了。
[编辑] 去掉不需要的服务
你是不是开启了SSH服务却从来没有远程登录过? 你了解启动时冒出来的那些东西吗?
执行 rc-status boot 和 rc-status default 这两个命令来看系统启动了哪些服务。我得到如下结果:
| 代码: rc-status boot |
Runlevel: boot keymaps [ started ] clock [ started ] localmount [ started ] consolefont [ started ] modules [ started ] net.lo [ started ] urandom [ started ] rmnologin [ started ] bootmisc [ started ] |
| 代码: rc-status default |
Runlevel: default xfs [ started ] dbus [ started ] sshd [ started ] cupsd [ started ] spamd [ started ] vixie-cron [ started ] syslog-ng [ started ] net.eth0 [ started ] numlock [ started ] alsasound [ started ] |
对于你不需要的服务,执行 rc-update del 服务名
- 注释: 你可能会需要要留着logger 和 cron 守护进程, 从boot运行级别里删除服务要格外小心。
如果你想看所有可用的init脚本:
| 代码: rc-config list |
|
Available init scripts acpid bootmisc boot checkfs boot checkroot boot clock boot consolefont boot crypto-loop cupsd default domainname default esound famd gpm hdparm hostname boot i8k keymaps boot lisa local default nonetwork localmount boot metalog default modules boot net.lo boot netmount nscd numlock default pg_autovacuum portmap postgresql pwcheck quota reslisa rmnologin boot rsyncd samba saslauthd serial boot sshd default svnserve urandom boot vixie-cron default webmin xdm boot xfs |
用 rc-config 你也能添加、删除、开始、停止init脚本。你可以执行 rc-config to 了解命令选项。
注释:在工作站上你能把xdm (X server) 服务移到 boot级。
[编辑] initng
gentoo的默认 init 是 sysvinit,但还有更多实验性的 init 如initng,。另见这里. 另一个替代品是 runit, 它支持并行加载, portage里有。
