1. System Boot
RunLevel viewing current levels
N 5 n No level 5 current level
Modify/etc/inittab//comment off restart health INITQ effective immediately
linux7 Default Run Level
0 Turn off the machine
1 stand-alone user mode
Multi-user mode with 2-character interface (network not supported)
3. Multi-user mode for character interface
4. Not assigned to use
5. Multi-user mode for graphical interface
6. Restart
Liunx Guided Overview
1. Boot boot
Host power-on self-test, load Bols hardware information
Read the MBR's boot file (Grub,lilo)
Booting the Linux kernel
Run the first process init (process number is always 1)
Go to the appropriate operating level
Run terminal, enter user name and password
2.init process and configuration files
The execution/sbin/init program is loaded, and the process ID is always 1.
Master configuration file/etc/inittab
18 Line: Id:5:initdefault:
32 Line: Ctrlaltdel
I'm going to hit an init q to get him into effect immediately.
3. Init script
/etc/rc.d/rc.syinit System Initialization
/ETC/RC.D/RC Specifies the run level, loading terminates the corresponding system service
/etc/rc.d/rc.local Boot Autorun Script
S for Level 1 n represents the last time no level
File syntax
[Set Project]:[runlevel]:[init action Behavior]:[Command Project]
Set up a project: up to 4 characters, representing the init work item, simple description
Operation level join: 0123456
Init operation:
Initdefault Indicates the default boot level
Sysinit initialization operation
Ctrlaltdel three-kin restart
Wait g indicates that the subsequent item must be completed before proceeding
Respawn indicates that the following init is the active reboot
2. System Service Control
Standalone Service startup method
Service AutoFS status//view AutoFS service running state
Service AutoFS//hit Enter to view Help parameters
Service AutoFS restart//Restart services
Stop//Stop start//start Relolad/Reload
Standalone service hand using absolute path start-up service
/etc/init.d/autofs
/etc/init.d/xxx/start/stop/restart/status
Service XXX Start/stop/restart/status
Auto Start service
Chkconfig--list | Less or/etc/init.d/*//lists the self-starting status of all services
Chkconfig--list sshd//View the startup level of the SSHD service
Chkconfig--level 5 sshd on//specify level to start service
Chkconfig--level 5 sshd off//specified level shutdown service
or Chkconfig--level CAPI on//Set 3 and 5 level self-booting
or chkconfig CAPI on//set 2345 auto Start
NTSYSV//default setting of the self-service at the current level
NTSYSV--level 35//default setting of self-service in 3 and 5 levels
Temporary services
/etc/rc.d/init.d///Standalone service path
/etc/xinetd.d///Temporary Services
PS View the shell used by the current system
PS aux process Management//a display current all processes u in user-oriented format output x displays all processes for the current user
Ps-e
Ps-elf//e Display all processes in the system L long format display F full format display
Stat Status R is running S sleep State Z zombie State
Top//view process TOP-D5//change every five seconds by default three seconds
Enter top press Shift+p to sort the CPU in reverse order by shirt+m in reverse memory
T in descending order according to the time consumed K kills the specified process
Pstree//Display in tree form
PSTREE-AUP//-a displays the full command line-u lists the user names that each process belongs to-p lists the corresponding PID numbers
Pstree-p WSYHT//View the process tree for a specified user
After the command that starts the program, add a & to indicate that the program is running in the background
CTRL + Z key//suspend current process (pause and move to background)
Jobs//View background Task List, when no ordinal is specified, the default value is the most recent task
FG//Restore the background task to the foreground, when no ordinal is specified, the default value is the most recent task
BG//Activate background is suspended task, when no ordinal is specified, the default value is the most recent task
-9 Forced Delete
PS aux | grep QQ View has not opened QQ process
Pgrep-l "Log"//Add an L output process name, not just ID, query has not opened log process
Pgrep-l-u wsyht//query Wsyht All processes opened by the user
Kill 23619//Kill a single process, delete with process number
Killall QQ or Pkill QQ//Kill single process, delete with process name
Pkill-9-U wsyht//force kick-out user
This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1790252
9, System guidance, service management, process management