文章目錄
0:停機1:單使用者形式,只root進行維護2:多使用者,不能使用net file system3:完全多使用者5:圖形化4:安全模式6:重啟 其實,可以通過查看/etc/rc.d/中的rc*.d的檔案來對比理解。。init 0,對應的系統會運行,/etc/rc.d/rc0.d裡指定的程式。我們來看下名稱。[root@localhost ~]# ls /etc/rc.d/rc0.d K01dnsmasq K15ksmtuned K35nmb K60crond K74lm_sensors K83portreserve K85rpcgssd K88iscsi K90network S00killallK10cups K16ksm K35smb K66gpsd K75netfs K84NetworkManager K85rpcidmapd K88rsyslog K92ip6tables S01haltK10saslauthd K20nfs K36mysqld K69rpcsvcgssd K75udev-post K84wpa_supplicant K86nfslock K89iscsid K92iptablesK10xfs K25sshd K50haldaemon K70vboxdrv K76openvpn K85mdmonitor K87alsasound K89netplugd K98qemuK15gpm K30sendmail K50netconsole K74acpid K83bluetooth K85messagebus K87rpcbind K89rdisc K99lvm2-monitor依照上述紅色字型,開機會執行的兩個進程是killall和halt,這兩個都表示為終止進程。故init 0是用於表示關機的。 init 1,對應的系統會運行,/etc/rc.d/rc1.d裡指定的程式。[root@localhost ~] # ls /etc/rc.d/rc1.dK01dnsmasq K15ksmtuned K35nmb K60crond K74lm_sensors K84NetworkManager K85rpcidmapd K88rsyslog K92ip6tables S99singleK10cups K16ksm K35smb K66gpsd K75netfs K84wpa_supplicant K86nfslock K89iscsid K92iptablesK10saslauthd K20nfs K36mysqld K69rpcsvcgssd K76openvpn K85mdmonitor K87alsasound K89netplugd K98qemuK10xfs K25sshd K50haldaemon K70vboxdrv K83bluetooth K85messagebus K87rpcbind K89rdisc S02lvm2-monitorK15gpm K30sendmail K50netconsole K74acpid K83portreserve K85rpcgssd K88iscsi K90network S26udev-post這個層級啟動的服務有三個,udev、lvm相關的和single(單一使用者模式的服務)。故此層級是單一使用者模式,只有root能用,不支援其他使用者。 init 2,對應的系統會運行,/etc/rc.d/rc2.d裡指定的程式。[root@localhost ~ ]# ls /etc/rc.d/rc2.d/K01dnsmasq K20nfs K36mysqld K74lm_sensors K85rpcgssd K89netplugd S08iptables S23NetworkManager S30vboxdrv S99localK10saslauthd K25sshd K50haldaemon K75netfs K85rpcidmapd K89rdisc S12rsyslog S24portreserve S35qemuK10xfs K30sendmail K50netconsole K76openvpn K86nfslock K90network S13rpcbind S25cups S85gpmK15ksmtuned K35nmb K66gpsd K83bluetooth K88iscsi S02lvm2-monitor S15mdmonitor S26acpid S90crondK16ksm K35smb K69rpcsvcgssd K84wpa_supplicant K89iscsid S08ip6tables S22messagebus S26udev-post S99alsasound這個層級啟動的服務多了,NetworkManager/iptables/acpid/alsa都已經開啟,但是nfs,smb,openvpn相關服務沒有開啟,這個層級不支援nfs。 init 3 , 對應的系統運行/etc/rc.d/rc3.d[root@localhost ~] # ls /etc/rc.d/rc3.d/K01dnsmasq K30sendmail K74lm_sensors K89rdisc S08iptables S18rpcidmapd S25cups S35qemu S85ksmtuned S99localK10saslauthd K36mysqld K76openvpn K90network S12rsyslog S19rpcgssd S25netfs S50bluetooth S90crondK10xfs K50netconsole K84wpa_supplicant K99lvm2-monitor S13iscsi S22messagebus S26acpid S50haldaemon S91nmbK20nfs K66gpsd K85mdmonitor S07iscsid S13rpcbind S23NetworkManager S26udev-post S84ksm S91smbK25sshd K69rpcsvcgssd K89netplugd S08ip6tables S14nfslock S24portreserve S30vboxdrv S85gpm S99alsasound這個層級nfs服務是開啟的,被成為完全多使用者模式。 init 4[root@localhost ~ ]# ls /etc/rc.d/rc4.d/K01dnsmasq K30sendmail K66gpsd K85mdmonitor S07iscsid S13rpcbind S23NetworkManager S26udev-post S84ksm S99localK10saslauthd K35nmb K69rpcsvcgssd K89netplugd S08ip6tables S14nfslock S24portreserve S30vboxdrv S85gpmK10xfs K35smb K74lm_sensors K89rdisc S08iptables S18rpcidmapd S25cups S35qemu S85ksmtunedK20nfs K36mysqld K76openvpn K90network S12rsyslog S19rpcgssd S25netfs S50bluetooth S90crondK25sshd K50netconsole K84wpa_supplicant K99lvm2-monitor S13iscsi S22messagebus S26acpid S50haldaemon S99alsasound此模式被稱為安全模式。 init 5[root@localhost ~ ]# ls /etc/rc.d/rc5.d/K01dnsmasq K25sshd K66gpsd K84wpa_supplicant K87rpcbind K90network S22messagebus S26udev-post S84ksm S99localK10saslauthd K30sendmail K69rpcsvcgssd K85mdmonitor K88iscsi K99lvm2-monitor S23NetworkManager S30vboxdrv S85ksmtunedK10xfs K36mysqld K74lm_sensors K85rpcgssd K89iscsid S08ip6tables S25cups S35qemu S91nmbK15gpm K50netconsole K76openvpn K85rpcidmapd K89netplugd S08iptables S25netfs S50bluetooth S91smbK20nfs K60crond K83portreserve K86nfslock K89rdisc S12rsyslog S26acpid S50haldaemon S99alsasound完整的圖形模式 init 6[root@localhost ~ ]# ls /etc/rc.d/rc6.d/K01dnsmasq K15ksmtuned K35nmb K60crond K74lm_sensors K83portreserve K85rpcgssd K88iscsi K90network S00killallK10cups K16ksm K35smb K66gpsd K75netfs K84NetworkManager K85rpcidmapd K88rsyslog K92ip6tables S01rebootK10saslauthd K20nfs K36mysqld K69rpcsvcgssd K75udev-post K84wpa_supplicant K86nfslock K89iscsid K92iptablesK10xfs K25sshd K50haldaemon K70vboxdrv K76openvpn K85mdmonitor K87alsasound K89netplugd K98qemuK15gpm K30sendmail K50netconsole K74acpid K83bluetooth K85messagebus K87rpcbind K89rdisc K99lvm2-monitor這個層級裡,只有兩個服務,一個為killall,一個是reboot,即,關閉現在的系統,重啟。故此層級是重啟。 不同的系統版本,可能裡面的檔案會不同,如果要查看,可以通過ll來看,其實他們都是軟串連。