Linux中 开机自启动目录

1、开机启动脚本

开机启动脚本是存放在 /etc/rc.d/rcX.d 目录中的,这里的X是runlevel,就是linux的运行级别,可以看到有rc0~rc6,共7种级别:

运行级别0:系统停机状态,系统默认运行级别不能设为0,否则不能正常启动
运行级别1:单用户工作状态,root权限,用于系统维护,禁止远程登陆
运行级别2:多用户状态(没有NFS)
运行级别3:完全的多用户状态(有NFS),登陆后进入控制台命令行模式
运行级别4:系统未使用,保留
运行级别5:X11控制台,登陆后进入图形GUI模式
运行级别6:系统正常关闭并重启,默认运行级别不能设为6,否则不能正常启动

  1. [root@wc1 Desktop]# pwd

  2. /root/Desktop

  3. [root@wc1 Desktop]# cd /etc/rc.d

  4.  
  5. [root@wc1 rc.d]# ls -l

  6. total 60

  7. drwxr-xr-x. 2 root root 4096 Aug 16 14:58 init.d

  8. -rwxr-xr-x. 1 root root 2617 Oct 16 2014 rc

    扫描二维码关注公众号,回复: 2453462 查看本文章
  9. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc0.d

  10. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc1.d

  11. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc2.d

  12. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc3.d

  13. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc4.d

  14. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc5.d

  15. drwxr-xr-x. 2 root root 4096 Aug 16 15:35 rc6.d

  16. -rwxr-xr-x. 1 root root 220 Oct 16 2014 rc.local

  17. -rwxr-xr-x. 1 root root 19914 Oct 16 2014 rc.sysinit

这里切换到rc3.d目录下,也就是完全的多用户模式:

  1. [root@wc1 rc.d]# cd rc3.d

  2. [root@wc1 rc3.d]# ls -l

  3. total 0

  4. lrwxrwxrwx. 1 root root 16 Aug 4 21:08 K01smartd -> ../init.d/smartd

  5. lrwxrwxrwx. 1 root root 17 Aug 4 21:06 K02oddjobd -> ../init.d/oddjobd

  6. lrwxrwxrwx. 1 root root 17 Aug 4 21:09 K05wdaemon -> ../init.d/wdaemon

  7. lrwxrwxrwx. 1 root root 16 Aug 4 21:08 K10psacct -> ../init.d/psacct

  8. lrwxrwxrwx. 1 root root 19 Aug 4 21:06 K10saslauthd -> ../init.d/saslauthd

  9. lrwxrwxrwx. 1 root root 22 Aug 4 21:06 K15htcacheclean -> ../init.d/htcacheclean

  10. lrwxrwxrwx. 1 root root 15 Aug 4 21:06 K15httpd -> ../init.d/httpd

  11. lrwxrwxrwx. 1 root root 24 Aug 4 21:08 K30spice-vdagentd -> ../init.d/spice-vdagentd

  12. lrwxrwxrwx. 1 root root 17 Aug 4 21:06 K50dnsmasq -> ../init.d/dnsmasq

  13. lrwxrwxrwx. 1 root root 20 Aug 4 21:05 K50netconsole -> ../init.d/netconsole

  14. lrwxrwxrwx. 1 root root 15 Aug 4 21:06 K50snmpd -> ../init.d/snmpd

  15. lrwxrwxrwx. 1 root root 19 Aug 4 21:06 K50snmptrapd -> ../init.d/snmptrapd

  16. lrwxrwxrwx. 1 root root 13 Aug 4 21:05 K60nfs -> ../init.d/nfs

  17. lrwxrwxrwx. 1 root root 20 Aug 4 21:05 K69rpcsvcgssd -> ../init.d/rpcsvcgssd

  18. lrwxrwxrwx. 1 root root 17 Aug 4 21:05 K73winbind -> ../init.d/winbind

  19. lrwxrwxrwx. 1 root root 14 Aug 4 13:47 K74ntpd -> ../init.d/ntpd

  20. lrwxrwxrwx. 1 root root 17 Aug 4 21:06 K75ntpdate -> ../init.d/ntpdate

  21. lrwxrwxrwx. 1 root root 19 Aug 4 21:08 K75quota_nld -> ../init.d/quota_nld

  22. lrwxrwxrwx. 1 root root 16 Aug 4 21:06 K76ypbind -> ../init.d/ypbind

  23. lrwxrwxrwx. 1 root root 15 Aug 4 13:47 K80kdump -> ../init.d/kdump

  24. lrwxrwxrwx. 1 root root 24 Aug 16 15:35 K84wpa_supplicant -> ../init.d/wpa_supplicant

  25. lrwxrwxrwx. 1 root root 21 Aug 4 21:05 K87restorecond -> ../init.d/restorecond

  26. lrwxrwxrwx. 1 root root 14 Aug 16 15:35 K88sssd -> ../init.d/sssd

  27. lrwxrwxrwx. 1 root root 15 Aug 4 21:05 K89rdisc -> ../init.d/rdisc

  28. lrwxrwxrwx. 1 root root 19 Aug 4 13:47 K95firstboot -> ../init.d/firstboot

  29. lrwxrwxrwx. 1 root root 14 Aug 4 21:08 K99rngd -> ../init.d/rngd

  30. lrwxrwxrwx. 1 root root 17 Aug 4 21:07 S01sysstat -> ../init.d/sysstat

  31. lrwxrwxrwx. 1 root root 22 Aug 4 21:07 S02lvm2-monitor -> ../init.d/lvm2-monitor

  32. lrwxrwxrwx. 1 root root 22 Aug 16 14:59 S03vmware-tools -> ../init.d/vmware-tools

  33. lrwxrwxrwx. 1 root root 19 Aug 4 21:06 S08ip6tables -> ../init.d/ip6tables

  34. lrwxrwxrwx. 1 root root 18 Aug 4 21:05 S08iptables -> ../init.d/iptables

  35. lrwxrwxrwx. 1 root root 17 Aug 4 21:05 S10network -> ../init.d/network

  36. lrwxrwxrwx. 1 root root 16 Aug 4 21:08 S11auditd -> ../init.d/auditd

  37. lrwxrwxrwx. 1 root root 21 Aug 4 21:02 S11portreserve -> ../init.d/portreserve

  38. lrwxrwxrwx. 1 root root 17 Aug 4 21:06 S12rsyslog -> ../init.d/rsyslog

  39. lrwxrwxrwx. 1 root root 18 Aug 4 21:08 S13cpuspeed -> ../init.d/cpuspeed

  40. lrwxrwxrwx. 1 root root 20 Aug 4 21:06 S13irqbalance -> ../init.d/irqbalance

  41. lrwxrwxrwx. 1 root root 17 Aug 4 21:03 S13rpcbind -> ../init.d/rpcbind

  42. lrwxrwxrwx. 1 root root 19 Aug 4 21:05 S15mdmonitor -> ../init.d/mdmonitor

  43. lrwxrwxrwx. 1 root root 20 Aug 4 21:02 S22messagebus -> ../init.d/messagebus

  44. lrwxrwxrwx. 1 root root 24 Aug 4 21:06 S23NetworkManager -> ../init.d/NetworkManager

  45. lrwxrwxrwx. 1 root root 17 Aug 16 15:35 S24nfslock -> ../init.d/nfslock

  46. lrwxrwxrwx. 1 root root 17 Aug 16 15:35 S24rpcgssd -> ../init.d/rpcgssd

  47. lrwxrwxrwx. 1 root root 26 Aug 4 21:07 S25blk-availability -> ../init.d/blk-availability

  48. lrwxrwxrwx. 1 root root 14 Aug 4 21:05 S25cups -> ../init.d/cups

  49. lrwxrwxrwx. 1 root root 15 Aug 4 21:05 S25netfs -> ../init.d/netfs

  50. lrwxrwxrwx. 1 root root 15 Aug 4 21:08 S26acpid -> ../init.d/acpid

  51. lrwxrwxrwx. 1 root root 19 Aug 4 21:05 S26haldaemon -> ../init.d/haldaemon

  52. lrwxrwxrwx. 1 root root 19 Aug 4 21:05 S26udev-post -> ../init.d/udev-post

  53. lrwxrwxrwx. 1 root root 16 Aug 4 21:06 S28autofs -> ../init.d/autofs

  54. lrwxrwxrwx. 1 root root 19 Aug 4 21:06 S50bluetooth -> ../init.d/bluetooth

  55. lrwxrwxrwx. 1 root root 14 Aug 4 21:07 S55sshd -> ../init.d/sshd

  56. lrwxrwxrwx. 1 root root 32 Aug 16 14:59 S57vmware-tools-thinprint -> ../init.d/vmware-tools-thinprint

  57. lrwxrwxrwx. 1 root root 15 Aug 16 15:35 S64mysql -> ../init.d/mysql

  58. lrwxrwxrwx. 1 root root 17 Aug 4 21:06 S80postfix -> ../init.d/postfix

  59. lrwxrwxrwx. 1 root root 19 Aug 4 21:03 S82abrt-ccpp -> ../init.d/abrt-ccpp

  60. lrwxrwxrwx. 1 root root 15 Aug 4 21:03 S82abrtd -> ../init.d/abrtd

  61. lrwxrwxrwx. 1 root root 15 Aug 4 21:06 S90crond -> ../init.d/crond

  62. lrwxrwxrwx. 1 root root 13 Aug 4 21:03 S95atd -> ../init.d/atd

  63. lrwxrwxrwx. 1 root root 20 Aug 4 21:06 S99certmonger -> ../init.d/certmonger

  64. lrwxrwxrwx. 1 root root 11 Aug 4 21:05 S99local -> ../rc.local

发现有很多K、S开头的后面跟着2位数字的文件,比如:K15httpd,K表示关闭,而15是指关闭的 优先级,也就是linux内核会按照系统预先设置好的runlevel,比如设置为3,那么就读取/etc/rc.d/rc3.d这个目录中的文件,然后按照先执行K开头,后执行S开头,并且从数字较小的开始执行,比如这里K15httpd,也就是排在第7个开始执行。

而且可以看到 K15httpd -> ../init.d/httpd ,也就是说 K15httpd是一个连接文件,连接到了相对于当前目录的上层目录下面的init.d/httpd,也就是目录/etc/rc.d/init.d :

  1. [root@wc1 rc3.d]# ls -l /etc/rc.d/init.d

  2. total 408

  3. -rwxr-xr-x. 1 root root 1288 Oct 16 2014 abrt-ccpp

  4. -rwxr-xr-x. 1 root root 1628 Oct 16 2014 abrtd

  5. -rwxr-xr-x. 1 root root 1642 Oct 16 2014 abrt-oops

  6. -rwxr-xr-x. 1 root root 1725 Aug 19 2010 acpid

  7. -rwxr-xr-x. 1 root root 2062 Jan 30 2012 atd

  8. -rwxr-xr-x. 1 root root 3580 Oct 15 2014 auditd

  9. -rwxr-xr-x. 1 root root 4043 Oct 16 2014 autofs

  10. -r-xr-xr-x. 1 root root 1340 Oct 16 2014 blk-availability

  11. -rwxr-xr-x. 1 root root 710 Nov 11 2010 bluetooth

  12. -rwxr-xr-x. 1 root root 2094 Oct 16 2014 certmonger

  13. -rwxr-xr-x. 1 root root 11355 Aug 13 2013 cpuspeed

  14. -rwxr-xr-x. 1 root root 2826 Nov 23 2013 crond

  15. -rwxr-xr-x. 1 root root 3034 Oct 15 2014 cups

  16. -rwxr-xr-x. 1 root root 1734 Jun 16 2014 dnsmasq

  17. -rwxr-xr-x. 1 root root 3245 Jul 9 2013 firstboot

  18. -rw-r--r--. 1 root root 19295 Jul 22 2014 functions

  19. -rwxr-xr-x. 1 root root 1801 Oct 15 2014 haldaemon

  20. -rwxr-xr-x. 1 root root 5866 Jul 22 2014 halt

  21. -rwxr-xr-x. 1 root root 2001 Oct 16 2014 htcacheclean

  22. -rwxr-xr-x. 1 root root 3371 Oct 16 2014 httpd

  23. -rwxr-xr-x. 1 root root 10804 Oct 15 2014 ip6tables

  24. -rwxr-xr-x. 1 root root 10688 Oct 15 2014 iptables

  25. -rwxr-xr-x. 1 root root 1938 Jun 2 2014 irqbalance

  26. -rwxr-xr-x. 1 root root 19476 Oct 16 2014 kdump

  27. -rwxr-xr-x. 1 root root 652 Jul 22 2014 killall

  28. -r-xr-xr-x. 1 root root 2134 Oct 16 2014 lvm2-lvmetad

  29. -r-xr-xr-x. 1 root root 2757 Oct 16 2014 lvm2-monitor

  30. -rwxr-xr-x. 1 root root 2571 Sep 5 2014 mdmonitor

  31. -rwxr-xr-x. 1 root root 2200 Sep 14 2012 messagebus

  32. -rwxr-xr-x. 1 root root 10815 Jul 3 2013 mysql

  33. -rwxr-xr-x. 1 root root 2989 Jul 22 2014 netconsole

  34. -rwxr-xr-x. 1 root root 6064 Jul 22 2014 netfs

  35. -rwxr-xr-x. 1 root root 6334 Jul 22 2014 network

  36. -rwxr-xr-x. 1 root root 2205 Oct 15 2014 NetworkManager

  37. -rwxr-xr-x. 1 root root 6878 Oct 16 2014 nfs

  38. -rwxr-xr-x. 1 root root 3526 Oct 16 2014 nfslock

  39. -rwxr-xr-x. 1 root root 1923 Jul 15 2013 ntpd

  40. -rwxr-xr-x. 1 root root 2043 Jul 15 2013 ntpdate

  41. -rwxr-xr-x. 1 root root 2261 Jun 25 2011 oddjobd

  42. -rwxr-xr-x. 1 root root 2023 Apr 3 2012 portreserve

  43. -rwxr-xr-x. 1 root root 3912 Feb 20 2014 postfix

  44. -rwxr-xr-x. 1 root root 1556 Jul 17 2012 psacct

  45. -rwxr-xr-x. 1 root root 2034 Mar 5 2014 quota_nld

  46. -rwxr-xr-x. 1 root root 1513 Sep 17 2013 rdisc

  47. -rwxr-xr-x. 1 root root 1822 Oct 16 2014 restorecond

  48. -rwxr-xr-x. 1 root root 1808 Dec 18 2011 rngd

  49. -rwxr-xr-x. 1 root root 2073 Feb 22 2013 rpcbind

  50. -rwxr-xr-x. 1 root root 2518 Oct 16 2014 rpcgssd

  51. -rwxr-xr-x. 1 root root 2305 Oct 16 2014 rpcidmapd

  52. -rwxr-xr-x. 1 root root 2464 Oct 16 2014 rpcsvcgssd

  53. -rwxr-xr-x. 1 root root 2011 Aug 15 2013 rsyslog

  54. -rwxr-xr-x. 1 root root 1698 Oct 16 2014 sandbox

  55. -rwxr-xr-x. 1 root root 2056 Jun 23 2014 saslauthd

  56. -rwxr-xr-x. 1 root root 647 Jul 22 2014 single

  57. -rwxr-xr-x. 1 root root 3002 Feb 22 2013 smartd

  58. -rwxr-xr-x. 1 root root 2162 Sep 15 2014 snmpd

  59. -rwxr-xr-x. 1 root root 1738 Sep 15 2014 snmptrapd

  60. -rwxr-xr-x. 1 root root 2472 Oct 15 2014 spice-vdagentd

  61. -rwxr-xr-x. 1 root root 4621 Oct 15 2014 sshd

  62. -rwxr-xr-x. 1 root root 2690 Oct 16 2014 sssd

  63. -rwxr-xr-x. 1 root root 1144 Oct 16 2014 sysstat

  64. -rwxr-xr-x. 1 root root 2294 Oct 16 2014 udev-post

  65. -rwxr-xr-x. 1 root root 38525 Aug 16 14:58 vmware-tools

  66. -rwxr-xr-x. 1 root root 15208 Aug 16 14:58 vmware-tools-thinprint

  67. -rwxr-xr-x. 1 root root 1674 Feb 22 2013 wdaemon

  68. -rwxr-xr-x. 1 root root 1608 Oct 15 2014 winbind

  69. -rwxr-xr-x. 1 root root 1866 Feb 4 2013 wpa_supplicant

  70. -rwxr-xr-x. 1 root root 4799 Feb 22 2013 ypbind

  71. [root@wc1 rc3.d]#

再来看一下/etc/rc.d/init.d/httpd文件的内容:

  1. [root@wc1 rc3.d]# cat /etc/rc.d/init.d/httpd

  2. #!/bin/bash

  3. #

  4. # httpd Startup script for the Apache HTTP Server

  5. #

  6. # chkconfig: - 85 15

  7. # description: The Apache HTTP Server is an efficient and extensible \

  8. # server implementing the current HTTP standards.

  9. # processname: httpd

  10. # config: /etc/httpd/conf/httpd.conf

  11. # config: /etc/sysconfig/httpd

  12. # pidfile: /var/run/httpd/httpd.pid

  13. #

  14. ### BEGIN INIT INFO

  15. # Provides: httpd

  16. # Required-Start: $local_fs $remote_fs $network $named

  17. # Required-Stop: $local_fs $remote_fs $network

  18. # Should-Start: distcache

  19. # Short-Description: start and stop Apache HTTP Server

  20. # Description: The Apache HTTP Server is an extensible server

  21. # implementing the current HTTP standards.

  22. ### END INIT INFO

  23.  
  24. # Source function library.

  25. . /etc/rc.d/init.d/functions

  26.  
  27. if [ -f /etc/sysconfig/httpd ]; then

  28. . /etc/sysconfig/httpd

  29. fi

  30.  
  31. # Start httpd in the C locale by default.

  32. HTTPD_LANG=${HTTPD_LANG-"C"}

  33.  
  34. # This will prevent initlog from swallowing up a pass-phrase prompt if

  35. # mod_ssl needs a pass-phrase from the user.

  36. INITLOG_ARGS=""

  37.  
  38. # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server

  39. # with the thread-based "worker" MPM; BE WARNED that some modules may not

  40. # work correctly with a thread-based MPM; notably PHP will refuse to start.

  41.  
  42. # Path to the apachectl script, server binary, and short-form for messages.

  43. apachectl=/usr/sbin/apachectl

  44. httpd=${HTTPD-/usr/sbin/httpd}

  45. prog=httpd

  46. pidfile=${PIDFILE-/var/run/httpd/httpd.pid}

  47. lockfile=${LOCKFILE-/var/lock/subsys/httpd}

  48. RETVAL=0

  49. STOP_TIMEOUT=${STOP_TIMEOUT-10}

  50.  
  51. # The semantics of these two functions differ from the way apachectl does

  52. # things -- attempting to start while running is a failure, and shutdown

  53. # when not running is also a failure. So we just do it the way init scripts

  54. # are expected to behave here.

  55. start() {

  56. echo -n $"Starting $prog: "

  57. LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS

  58. RETVAL=$?

  59. echo

  60. [ $RETVAL = 0 ] && touch ${lockfile}

  61. return $RETVAL

  62. }

  63.  
  64. # When stopping httpd, a delay (of default 10 second) is required

  65. # before SIGKILLing the httpd parent; this gives enough time for the

  66. # httpd parent to SIGKILL any errant children.

  67. stop() {

  68. echo -n $"Stopping $prog: "

  69. killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd

  70. RETVAL=$?

  71. echo

  72. [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}

  73. }

  74. reload() {

  75. echo -n $"Reloading $prog: "

  76. if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then

  77. RETVAL=6

  78. echo $"not reloading due to configuration syntax error"

  79. failure $"not reloading $httpd due to configuration syntax error"

  80. else

  81. # Force LSB behaviour from killproc

  82. LSB=1 killproc -p ${pidfile} $httpd -HUP

  83. RETVAL=$?

  84. if [ $RETVAL -eq 7 ]; then

  85. failure $"httpd shutdown"

  86. fi

  87. fi

  88. echo

  89. }

  90.  
  91. # See how we were called.

  92. case "$1" in

  93. start)

  94. start

  95. ;;

  96. stop)

  97. stop

  98. ;;

  99. status)

  100. status -p ${pidfile} $httpd

  101. RETVAL=$?

  102. ;;

  103. restart)

  104. stop

  105. start

  106. ;;

  107. condrestart|try-restart)

  108. if status -p ${pidfile} $httpd >&/dev/null; then

  109. stop

  110. start

  111. fi

  112. ;;

  113. force-reload|reload)

  114. reload

  115. ;;

  116. graceful|help|configtest|fullstatus)

  117. $apachectl $@

  118. RETVAL=$?

  119. ;;

  120. *)

  121. echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"

  122. RETVAL=2

  123. esac

  124.  
  125. exit $RETVAL

  126. [root@wc1 rc3.d]#

2、另一个开机自启动目录

这个目录就是:/etc/init.d,目录里也存放了开机自启动脚本。

不过可以发现这个目录只不过是一个连接目录,实际上对应的就是/etc/rc.d/init.d,也就是上面讲到的目录,目录中的文件和/etc/rc.d/init.d 中的文件完全一致。

  1. [root@wc1 rc3.d]# ls -l /etc/init.d

  2. lrwxrwxrwx. 1 root root 11 Aug 4 21:02 /etc/init.d -> rc.d/init.d

  3.  
  4. [root@wc1 rc3.d]# ls -l /etc/init.d/

  5. total 408

  6. -rwxr-xr-x. 1 root root 1288 Oct 16 2014 abrt-ccpp

  7. -rwxr-xr-x. 1 root root 1628 Oct 16 2014 abrtd

  8. -rwxr-xr-x. 1 root root 1642 Oct 16 2014 abrt-oops

  9. -rwxr-xr-x. 1 root root 1725 Aug 19 2010 acpid

  10. -rwxr-xr-x. 1 root root 2062 Jan 30 2012 atd

  11. -rwxr-xr-x. 1 root root 3580 Oct 15 2014 auditd

  12. -rwxr-xr-x. 1 root root 4043 Oct 16 2014 autofs

  13. -r-xr-xr-x. 1 root root 1340 Oct 16 2014 blk-availability

  14. -rwxr-xr-x. 1 root root 710 Nov 11 2010 bluetooth

  15. -rwxr-xr-x. 1 root root 2094 Oct 16 2014 certmonger

  16. -rwxr-xr-x. 1 root root 11355 Aug 13 2013 cpuspeed

  17. -rwxr-xr-x. 1 root root 2826 Nov 23 2013 crond

  18. -rwxr-xr-x. 1 root root 3034 Oct 15 2014 cups

  19. -rwxr-xr-x. 1 root root 1734 Jun 16 2014 dnsmasq

  20. -rwxr-xr-x. 1 root root 3245 Jul 9 2013 firstboot

  21. -rw-r--r--. 1 root root 19295 Jul 22 2014 functions

  22. -rwxr-xr-x. 1 root root 1801 Oct 15 2014 haldaemon

  23. -rwxr-xr-x. 1 root root 5866 Jul 22 2014 halt

  24. -rwxr-xr-x. 1 root root 2001 Oct 16 2014 htcacheclean

  25. -rwxr-xr-x. 1 root root 3371 Oct 16 2014 httpd

  26. -rwxr-xr-x. 1 root root 10804 Oct 15 2014 ip6tables

  27. -rwxr-xr-x. 1 root root 10688 Oct 15 2014 iptables

  28. -rwxr-xr-x. 1 root root 1938 Jun 2 2014 irqbalance

  29. -rwxr-xr-x. 1 root root 19476 Oct 16 2014 kdump

  30. -rwxr-xr-x. 1 root root 652 Jul 22 2014 killall

  31. -r-xr-xr-x. 1 root root 2134 Oct 16 2014 lvm2-lvmetad

  32. -r-xr-xr-x. 1 root root 2757 Oct 16 2014 lvm2-monitor

  33. -rwxr-xr-x. 1 root root 2571 Sep 5 2014 mdmonitor

  34. -rwxr-xr-x. 1 root root 2200 Sep 14 2012 messagebus

  35. -rwxr-xr-x. 1 root root 10815 Jul 3 2013 mysql

  36. -rwxr-xr-x. 1 root root 2989 Jul 22 2014 netconsole

  37. -rwxr-xr-x. 1 root root 6064 Jul 22 2014 netfs

  38. -rwxr-xr-x. 1 root root 6334 Jul 22 2014 network

  39. -rwxr-xr-x. 1 root root 2205 Oct 15 2014 NetworkManager

  40. -rwxr-xr-x. 1 root root 6878 Oct 16 2014 nfs

  41. -rwxr-xr-x. 1 root root 3526 Oct 16 2014 nfslock

  42. -rwxr-xr-x. 1 root root 1923 Jul 15 2013 ntpd

  43. -rwxr-xr-x. 1 root root 2043 Jul 15 2013 ntpdate

  44. -rwxr-xr-x. 1 root root 2261 Jun 25 2011 oddjobd

  45. -rwxr-xr-x. 1 root root 2023 Apr 3 2012 portreserve

  46. -rwxr-xr-x. 1 root root 3912 Feb 20 2014 postfix

  47. -rwxr-xr-x. 1 root root 1556 Jul 17 2012 psacct

  48. -rwxr-xr-x. 1 root root 2034 Mar 5 2014 quota_nld

  49. -rwxr-xr-x. 1 root root 1513 Sep 17 2013 rdisc

  50. -rwxr-xr-x. 1 root root 1822 Oct 16 2014 restorecond

  51. -rwxr-xr-x. 1 root root 1808 Dec 18 2011 rngd

  52. -rwxr-xr-x. 1 root root 2073 Feb 22 2013 rpcbind

  53. -rwxr-xr-x. 1 root root 2518 Oct 16 2014 rpcgssd

  54. -rwxr-xr-x. 1 root root 2305 Oct 16 2014 rpcidmapd

  55. -rwxr-xr-x. 1 root root 2464 Oct 16 2014 rpcsvcgssd

  56. -rwxr-xr-x. 1 root root 2011 Aug 15 2013 rsyslog

  57. -rwxr-xr-x. 1 root root 1698 Oct 16 2014 sandbox

  58. -rwxr-xr-x. 1 root root 2056 Jun 23 2014 saslauthd

  59. -rwxr-xr-x. 1 root root 647 Jul 22 2014 single

  60. -rwxr-xr-x. 1 root root 3002 Feb 22 2013 smartd

  61. -rwxr-xr-x. 1 root root 2162 Sep 15 2014 snmpd

  62. -rwxr-xr-x. 1 root root 1738 Sep 15 2014 snmptrapd

  63. -rwxr-xr-x. 1 root root 2472 Oct 15 2014 spice-vdagentd

  64. -rwxr-xr-x. 1 root root 4621 Oct 15 2014 sshd

  65. -rwxr-xr-x. 1 root root 2690 Oct 16 2014 sssd

  66. -rwxr-xr-x. 1 root root 1144 Oct 16 2014 sysstat

  67. -rwxr-xr-x. 1 root root 2294 Oct 16 2014 udev-post

  68. -rwxr-xr-x. 1 root root 38525 Aug 16 14:58 vmware-tools

  69. -rwxr-xr-x. 1 root root 15208 Aug 16 14:58 vmware-tools-thinprint

  70. -rwxr-xr-x. 1 root root 1674 Feb 22 2013 wdaemon

  71. -rwxr-xr-x. 1 root root 1608 Oct 15 2014 winbind

  72. -rwxr-xr-x. 1 root root 1866 Feb 4 2013 wpa_supplicant

  73. -rwxr-xr-x. 1 root root 4799 Feb 22 2013 ypbind

3、总结

/etc/rc.d/rcX.d 目录下面的文件是连接文件,连接到/etc/rc.d/init.d 目录下的文件,而/etc/init.d 目录就是链接目录,连接到 /etc/rc.d/init.d 目录。

猜你喜欢

转载自blog.csdn.net/l_liangkk/article/details/81268409