chkconfig 背后的故事

现象:[root@oldboyedu01-nb ~]# chkconfig iptables on
      [root@oldboyedu01-nb ~]# chkconfig |grep ipt
      iptables        0:off 1:off 2:on 3:on 4:on 5:on 6:off
      [root@oldboyedu01-nb ~]# ll  /etc/rc3.d/ |grep ipt
      lrwxrwxrwx  1 root root 18 Jan 16 10:42 S08iptables -> ../init.d/iptables

      [root@oldboyedu01-nb ~]# chkconfig iptables off
      [root@oldboyedu01-nb ~]# ll  /etc/rc3.d/ |grep ipt
      lrwxrwxrwx  1 root root 18 Jan 16 10:43 K92iptables -> ../init.d/iptables

猜想:自己创建一个S08iptables与K92iptables文件科控制开机启动

      即:chkconfig iptables on    ====== /etc/rc3.d  S08iptables -> ../init.d/iptables
          chkconfig iptables off   ====== /etc/rc3.d  K92iptables -> ../init.d/iptables

验证:1.chkconfig iptables on    ====== /etc/rc3.d  S08iptables -> ../init.d/iptables

                [root@oldboyedu01-nb ~]# chkconfig |grep ipt
        iptables        0:off 1:off 2:off 3:off 4:off 5:off 6:off
                [root@oldboyedu01-nb ~]# ls -l /etc/rc3.d/|grep ipt
        [root@oldboyedu01-nb ~]# ln -s /etc/init.d/iptables  /etc/rc3.d/S08iptables
        [root@oldboyedu01-nb ~]# ls -l /etc/rc3.d/|grep ipt
        lrwxrwxrwx  1 root root 20 Jan 16 10:48 S08iptables -> /etc/init.d/iptables
        [root@oldboyedu01-nb ~]#
        [root@oldboyedu01-nb ~]# chkconfig |grep ipt
        iptables        0:off 1:off 2:off 3:on 4:off 5:off 6:off

      2.chkconfig iptables off   ====== /etc/rc3.d  K92iptables -> ../init.d/iptables

        [root@oldboyedu-01 ~]# chkconfig |grep ipt
        iptables        0:off 1:off 2:on 3:on 4:on 5:on 6:off
        [root@oldboyedu-01 ~]# ln -s /etc/init.d/iptables  /etc/rc3.d/K92iptables
        [root@oldboyedu-01 ~]# ll /etc/rc3.d/ |grep ipt
        lrwxrwxrwx. 1 root root 20 Jun 22 02:27 K92iptables -> /etc/init.d/iptables
        [root@oldboyedu-01 ~]# chkconfig |grep ipt
        iptables        0:off 1:off 2:on 3:off 4:on 5:on 6:off

 结论——猜想成立
         chkconfig iptables on    ====== /etc/rc3.d  S08iptables -> ../init.d/iptables
         chkconfig iptables off   ====== /etc/rc3.d  K92iptables -> ../init.d/iptables

猜你喜欢

转载自www.cnblogs.com/lxs0817/p/9266227.html