2020-01-27--把脚本添加到系统服务

[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。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容