[root@zhangguokui scripts]# vim zhangxiaobu #<==建立脚本
# chkconfig: 2345 10 90 #<==2345是默认启动级别,10是启动优先级,90是停止优先级
# ceshi
echo hello xiaobu
~
~
~
"zhangxiaobu" 3L, 51C written
[root@zhangguokui scripts]# ls
zhangxiaobu
[root@zhangguokui scripts]# mv zhangxiaobu /etc/init.d/ #<==步骤1
[root@zhangguokui init.d]# chkconfig --add zhangxiaobu #<==步骤2
[root@zhangguokui init.d]# chkconfig --list|grep zhangxiaobu
zhangxiaobu 0:off 1:off 2:on 3:on 4:on 5:on 6:off
进入vmware
setup,进入system services,可以看到zhangxiaobu。