linux启动的过程:
1、启动BIOS
2、读取MBR
3、加载grub
4、kernel
5、启动第一个程序init
6、读取/etc/inittab配置文件==>/etc/rc.d/rc.sysinit==>/etc/rc.d/rc.脚本
7、启动mingetty进程。
=====================================================================================================
在启动文件下加入echo "ni hao" >>/tmp/test.txt
[root@xusx ~]# vim /etc/rc.local
[root@xusx ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
echo "ni hao" >> /tmp/test.txt
重启系统reboot发现在/tmp/test.txt下多出刚刚编写的
[root@xusx ~]# cat /tmp/test.txt
ni hao