redhat中的chkconfig

1. chkconfig是redhat中的服务配置工具

2. 要使不在chkconfig目录中的服务支持该命令,需要改该服务脚本的工具

  例如:/etc/init.d/sshd

  1.注释中必须有这两行 (chkconfig会查看所有注释行)

    # chkconfig: 2345 55 25  
    # description: SSH is a protocol for secure remote shell access. 描述文件

    1.chkconfig参数1:表示在运行级别2345中默认代开 使用-表示默认关闭

    2.chkconfig参数2:S55

    3.chkconfig参数3:K45

  2. 要在服务脚本中实现POSIX规范中的函数:start() stop()等

  3.这时可以使用 service xxxx(脚本名)  start/stop等命令立刻启动或关闭

3.要使该脚本每次启动都生效

  1.chkconfig --add xxxx注册服务名

    1.chkconfig会根据该脚本的信息,自动到相应运行级rcX.d中创建链接

  2.chkconfig xxxx off 配置系统启动时该脚本默认关闭

  3.chkconfig xxxx on 配置系统启动时该脚本默认启动

    

4.chkconfig中的特殊服务xinetd ,xinetd服务下挂载一系列服务 ,脚本放在/etc/xinetd.d/

  1.要启动xinetd挂在的服务

    1.chkconfig xinetd on

    2.chkconfig  xxx on

    3.service xxx start    

posted @ 2013-04-05 19:14  屁屁熊  阅读(1079)  评论(0编辑  收藏  举报