If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3?
I thought the answer to this question was yes. But when I look on my RHEL 6 system I see that many of rcX.d directories contain same symbolic links.
In My /etc/rc.d/rc0.d/
[root@centos6 rc.d]# ls -lah /etc/rc.d/rc0.d/
total 8.0K
drwxr-xr-x. 2 root root 4.0K Jun 27 11:59 .
drwxr-xr-x. 10 root root 4.0K Jul 9 15:06 ..
lrwxrwxrwx. 1 root root 13 Jun 12 13:02 K05atd -> ../init.d/atd
lrwxrwxrwx. 1 root root 14 Jun 12 13:01 K10cups -> ../init.d/cups
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd
lrwxrwxrwx. 1 root root 18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve
lrwxrwxrwx. 1 root root 14 Jun 12 10:58 K25sshd -> ../init.d/sshd
lrwxrwxrwx. 1 root root 17 Jun 12 10:57 K30postfix -> ../init.d/postfix
lrwxrwxrwx. 1 root root 17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq
lrwxrwxrwx. 1 root root 20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx. 1 root root 15 Jun 12 10:57 K60crond -> ../init.d/crond
lrwxrwxrwx. 1 root root 25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service
lrwxrwxrwx. 1 root root 17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd
lrwxrwxrwx. 1 root root 21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11
lrwxrwxrwx. 1 root root 17 Jun 12 12:26 K73winbind -> ../init.d/winbind
lrwxrwxrwx. 1 root root 19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon
lrwxrwxrwx. 1 root root 26 Jun 12 10:58 K75blk-availability -> ../init.d/blk-availability
lrwxrwxrwx. 1 root root 15 Jun 12 11:15 K75netfs -> ../init.d/netfs
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 K75udev-post -> ../init.d/udev-post
lrwxrwxrwx. 1 root root 24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager
lrwxrwxrwx. 1 root root 24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant
lrwxrwxrwx. 1 root root 19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor
lrwxrwxrwx. 1 root root 20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus
lrwxrwxrwx. 1 root root 20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd
lrwxrwxrwx. 1 root root 21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond
lrwxrwxrwx. 1 root root 16 Jun 12 10:58 K88auditd -> ../init.d/auditd
lrwxrwxrwx. 1 root root 15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi
lrwxrwxrwx. 1 root root 17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog
lrwxrwxrwx. 1 root root 16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid
lrwxrwxrwx. 1 root root 21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve
lrwxrwxrwx. 1 root root 15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc
lrwxrwxrwx. 1 root root 17 Jun 12 11:15 K90network -> ../init.d/network
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables
lrwxrwxrwx. 1 root root 18 Jun 12 10:57 K92iptables -> ../init.d/iptables
lrwxrwxrwx. 1 root root 22 Jun 12 10:58 K99lvm2-monitor -> ../init.d/lvm2-monitor
lrwxrwxrwx. 1 root root 17 Jun 12 11:15 S00killall -> ../init.d/killall
lrwxrwxrwx. 1 root root 14 Jun 12 11:15 S01halt -> ../init.d/halt
lrwxrwxrwx. 1 root root 15 Jun 26 12:32 S95jexec -> ../init.d/jexec
And in /etc/rc.d/rc1.d/ I see the same set of symbolic links as in rc0.d plus extra links. This seems to indicate that the directories rc0.d, rc1.d are independent and that to get to run level 1 it does not execute the stuff in run level 0. Which means that bad things can happen if some how the symbolic links in rc0.d were not exactly replicated in rc1.d, ... etc.
So how does it really work? Does it just scan the files in a specific rc.X dir or run through all rc.X dirs that have a lower level than rc level passed to init?
[root@centos6 rc.d]# ls -lah /etc/rc.d/rc1.d/
total 8.0K
drwxr-xr-x. 2 root root 4.0K Jun 27 11:59 .
drwxr-xr-x. 10 root root 4.0K Jul 9 15:06 ..
lrwxrwxrwx. 1 root root 13 Jun 12 13:02 K05atd -> ../init.d/atd
lrwxrwxrwx. 1 root root 14 Jun 12 13:01 K10cups -> ../init.d/cups
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd
lrwxrwxrwx. 1 root root 18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve
lrwxrwxrwx. 1 root root 14 Jun 12 10:58 K25sshd -> ../init.d/sshd
lrwxrwxrwx. 1 root root 17 Jun 12 10:57 K30postfix -> ../init.d/postfix
lrwxrwxrwx. 1 root root 17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq
lrwxrwxrwx. 1 root root 20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx. 1 root root 15 Jun 12 10:57 K60crond -> ../init.d/crond
lrwxrwxrwx. 1 root root 25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service
lrwxrwxrwx. 1 root root 17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd
lrwxrwxrwx. 1 root root 21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11
lrwxrwxrwx. 1 root root 17 Jun 12 12:26 K73winbind -> ../init.d/winbind
lrwxrwxrwx. 1 root root 19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon
lrwxrwxrwx. 1 root root 15 Jun 12 11:15 K75netfs -> ../init.d/netfs
lrwxrwxrwx. 1 root root 24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager
lrwxrwxrwx. 1 root root 24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant
lrwxrwxrwx. 1 root root 19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor
lrwxrwxrwx. 1 root root 20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus
lrwxrwxrwx. 1 root root 20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd
lrwxrwxrwx. 1 root root 21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond
lrwxrwxrwx. 1 root root 16 Jun 12 10:58 K88auditd -> ../init.d/auditd
lrwxrwxrwx. 1 root root 15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi
lrwxrwxrwx. 1 root root 17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog
lrwxrwxrwx. 1 root root 16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid
lrwxrwxrwx. 1 root root 21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve
lrwxrwxrwx. 1 root root 15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc
lrwxrwxrwx. 1 root root 17 Jun 12 11:15 K90network -> ../init.d/network
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables
lrwxrwxrwx. 1 root root 18 Jun 12 10:57 K92iptables -> ../init.d/iptables
lrwxrwxrwx. 1 root root 22 Jun 12 10:58 S02lvm2-monitor -> ../init.d/lvm2-monitor
lrwxrwxrwx. 1 root root 26 Jun 12 10:58 S25blk-availability -> ../init.d/blk-availability
lrwxrwxrwx. 1 root root 19 Jun 12 10:57 S26udev-post -> ../init.d/udev-post
lrwxrwxrwx. 1 root root 15 Jun 26 12:32 S95jexec -> ../init.d/jexec
lrwxrwxrwx. 1 root root 16 Jun 12 11:15 S99single -> ../init.d/single