首页 > 系统服务 > 详细

Linux 之 简单制作chkconfig启动文件

时间:2018-05-07 20:52:16      阅读:233      评论:0      收藏:0      [点我收藏+]
简单制作chkconfig 启动文件
1.在/etc/init.d/ 目录下创建一个kang文件
vi /etc/init.d/kang
# chkconfig: 2345 24 76          
#description: This is TEST
echo my name is mingkang
~

备注:chkcconfig:2345 24 76
第一列2345:为系统的启动级别,默认都为on   
第二列24:为服务启动数(可随意)
第三列76:为服务关闭数(可随意)
数字函意如下:
[root@localhost rc3.d]# pwd
/etc/rc.d/rc3.d
[root@localhost rc3.d]# ll | grep kang
lrwxrwxrwx  1 root root 14 May  7 20:16 S24kang -> ../init.d/kang

2.修改脚本可执行权限
[root@localhost init.d]# chmod +x kang

3.添加到chkconfig服务中
[root@localhost init.d]# chkconfig --add kang
[root@localhost init.d]# chkconfig | grep kang
kang            0:off   1:off   2:on    3:on    4:on    5:on    6:off

Linux 之 简单制作chkconfig启动文件

原文:http://blog.51cto.com/12965094/2113724

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!