linux etc/init 与etc/init.d的区别

来源:互联网 发布:金融网络销售做不得 编辑:程序博客网 时间:2024/05/16 19:20

一直迷惑/etc/init   与/etc/init/init.d,最近有点时间学习下,打开目录

/etc/init   目录下的都是配置文件

[root@iZ9488z4qfcZ init]# ls
control-alt-delete.conf  prefdm.conf         rcS-emergency.conf        readahead-disable-services.conf  tty.conf
init-system-dbus.conf    quit-plymouth.conf  rcS-sulogin.conf          serial.conf
kexec-disable.conf       rc.conf             readahead-collector.conf  splash-manager.conf
plymouth-shutdown.conf   rcS.conf            readahead.conf            start-ttys.conf

/etc/init.d 目录下都是可执行文件,都是开机启动项

[root@iZ9488z4qfcZ init.d]# ls
abrt-ccpp  atd               functions  iptables      lvm2-monitor  netfs    ntpdate    rdisc        saslauthd  sysstat
abrtd      auditd            gshelld    irqbalance    mdmonitor     network  php-fpm    restorecond  single     udev-post
abrt-oops  blk-availability  haldaemon  kdump         messagebus    nginx    postfix    rngd         smartd     vsftpd
acpid      cpuspeed          halt       killall       mysqld        nscd     psacct     rsyslog      sshd
aegis      crond             ip6tables  lvm2-lvmetad  netconsole    ntpd     quota_nld  sandbox      svnser


[root@iZ9488z4qfcZ etc]# ls -al

total 1560

drwxr-xr-x.  2 root root   4096 Aug 14  2014 init
lrwxrwxrwx.  1 root root     11 Aug 14  2014 init.d -> rc.d/init.d

lrwxrwxrwx.  1 root root      7 Aug 14  2014 rc -> rc.d/rc
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc0.d -> rc.d/rc0.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc1.d -> rc.d/rc1.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc2.d -> rc.d/rc2.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc3.d -> rc.d/rc3.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc4.d -> rc.d/rc4.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc5.d -> rc.d/rc5.d
lrwxrwxrwx.  1 root root     10 Aug 14  2014 rc6.d -> rc.d/rc6.d
drwxr-xr-x. 10 root root   4096 Sep 26  2014 rc.d
lrwxrwxrwx.  1 root root     13 Aug 14  2014 rc.local -> rc.d/rc.local
-rwxr-xr-x   1 root root    220 Sep 26  2014 rc.local.bak
lrwxrwxrwx.  1 root root     15 Aug 14  2014 rc.sysinit -> rc.d/rc.sysinit
-rw-r--r--.  1 root root    966 Nov 23  2013 readahead.conf
drwxr-xr-x.  2 root root   4096 Aug 14  2014 redhat-lsb

lrwxrwxrwx.  1 root root     14 Aug 14  2014 redhat-release -> centos-release

ls -al 看到init.d是/etc/rc.d/init.d的软链接,估计是因为好操作吧,姑且这么认为

移步/etc/rc 果然
[root@iZ9488z4qfcZ etc]# cd rc.d
[root@iZ9488z4qfcZ rc.d]# ls
init.d  rc  rc0.d  rc1.d  rc2.d  rc3.d  rc4.d  rc5.d  rc6.d  rc.local  rc.sysinit
[root@iZ9488z4qfcZ rc.d]# cd init.d/
[root@iZ9488z4qfcZ init.d]# ls
abrt-ccpp  atd               functions  iptables      lvm2-monitor  netfs    ntpdate    rdisc        saslauthd  sysstat
abrtd      auditd            gshelld    irqbalance    mdmonitor     network  php-fpm    restorecond  single     udev-post
abrt-oops  blk-availability  haldaemon  kdump         messagebus    nginx    postfix    rngd         smartd     vsftpd
acpid      cpuspeed          halt       killall       mysqld        nscd     psacct     rsyslog      sshd



0 0
原创粉丝点击