(1) View Run level command description:
#Runlevel to view the levels that are running
#Who –r view the current level of the run and the level of the last run
9.5-2.1 can see that switching between different levels and then running commands to see different effects:
650) this.width=650; "title=" 9.5-2.1.jpg "src=" http://s3.51cto.com/wyfs02/M02/72/A7/wKioL1Xquz7x0kNcAAFi01hsj_ Y000.jpg "alt=" Wkiol1xquz7x0kncaafi01hsj_y000.jpg "/>
Centos 5
Linux the run-level configuration file path is: /etc/inittab under
9.5-2.2 as shown:
650) this.width=650; "title=" 9.5-2.2.jpg "src=" Http://s3.51cto.com/wyfs02/M00/72/A7/wKioL1Xqu26h_ J8paaes2sfeo4w462.jpg "alt=" Wkiol1xqu26h_j8paaes2sfeo4w462.jpg "/>
where the * * * part is Action and the corresponding Process
Id:runlevel:action:process which Process can hide
Action :
Wait : Wait Switch to this level to run one time
respawn : etc. Process stop, wait to start again
Initdefault : Sets the default level, Process omitted
Sysinit : Specify /etc/rc.d/rc.sysinit
(2) ID : 3 : Initdefault :
Si::sysinit:/etc/rc.d/rc.sysnit System Initialization tool, activating swap partition, etc.
L0:0:WAIT:/ETC/RC.D/RC.SYSINIT/RC 0
....
L6:6AIT:/ETC/RC.D/RC.SYSINIT/RC 6
Description rc0-6 The run level means reading /etc/rc.d/rc.0.d/ All Files
k* k##* off State The smaller the number, the more it runs and usually relies on other services
s* s##* Open State The smaller the number, the more running, the service that is dependent on
two digits ##/etc/rc.d/init.d/ Display under directory
For SRV in/etc/rc.d/rc0.d/k*;d o
$srv stop
Done
For SRV in/etc/rc.d/rc0.d/s*;d o
$srv start
Done
To view different types of links under different levels:
#ls/etc/rc.d #ls/ETC/RC.D/RC #ls/etc/rc.d/rc/rc0.d
9.5-2.3 as shown:
650) this.width=650; "title=" 9.5-2.3.jpg "src=" http://s3.51cto.com/wyfs02/M01/72/A7/ Wkiol1xqu5zsrkfxaasi7blisma027.jpg "alt=" Wkiol1xqu5zsrkfxaasi7blisma027.jpg "/>
middle section is the link type 0-6 9.5-2.4 and 9.5-2.5 show: command is #ls/etc/rc.d/rc3.d which * S10network is open The latter is *k90network off state, chkconfig command view adjustment link open close
650) this.width=650; "title=" 9.5-2.4.jpg "src=" http://s3.51cto.com/wyfs02/M02/72/A7/wKioL1Xqu9mjF-X3AAP-zPdq_ Bw501.jpg "alt=" wkiol1xqu9mjf-x3aap-zpdq_bw501.jpg "/>650" this.width=650; "title=" 9.5-2.5.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m02/72/ab/wkiom1xqub6zidtcaaew4n3cf7m188.jpg "alt=" Wkiom1xqub6zidtcaaew4n3cf7m188.jpg "/>
( 3 ) Chkconfig command,
Add:
Sysv service scripts are placed in the /etc/rc.d/init.d (/ETC/INIT.D)
First create:
#!/bin/bash
#
#chkconfig: LLL ( number ) nn (number after S ) nn ( number of K )
Add again #Chkconfig –add name
Delete: Chkconfig–del name
#Chkconfig--level
#Chkconfig –list
( 4 ) #ls/etc/rc.d/rc.sysinit viewing system initialization Scripts
a , set host name
b , set Welcome information
C , activate Udev and the SELinux
D , Mount /etc/fstab File system defined in the file
e , interval root file system, and re-mount the root filesystem in read-write mode
F , set the system clock,
g , activate Swap Equipment
h , according to /etc/sysctl.conf file Set kernel parameters
I , activate LVM and Software RAID Equipment
J , load drivers for additional devices
k , Cleanup operations
/sbin/init à (/etc/inittab) à Set Run Level à run the system initialization script à Close or open the appropriate service à Login
CentOS 6
Init The program is: Upstart , configuration Files /etc/inittab , /etc/init/*.conf
#cd/etc/init
#ls rc.conf Running the service
#ls rcs.conf Startup Scripts
9.5-2.6 as shown:
650) this.width=650; "title=" 9.5-2.6.jpg "src=" http://s3.51cto.com/wyfs02/M01/72/A7/ Wkiol1xqvcaj2w1paahi1xwazrq510.jpg "alt=" Wkiol1xqvcaj2w1paahi1xwazrq510.jpg "/>
Linux Run Level