This chapter structure
- Boot process
- Start fault exclusion
- Service Control and switching the operating level
- Optimization of the startup process
Boot process overview:
1. POST
2.MBR boot
3.GRUB menu: selection menu belonging to system startup, in case of mounting two systems can be seen
4 to load the kernel (Kernel)
5.init initialization process: the system components necessary to complete the loading environment variables, the operation of the system
init process
init process
- Run by the Linux kernel alive / sbin / init
- The system is the first process
- PID (process mark) is always No. 1
Systemd unit type:
Unit Type | extension name | Explanation |
---|---|---|
Service | .service | Describe a system service |
Socket | .socket | A description of inter-process communication socket |
Device | .device | Describes a core recognition device file |
Mount | .mount | Describe a file system mount point |
Automouunt | .automout | Description Automatic a mount point of the file system |
Swap | .swap | Describes a switching device memory or swap file |
Path | .path | A description of the file system file or directory |
Timer | .timer | Describes a timer (for the scheduled tasks to achieve similar cron) |
Snapshot | .snaphshot | To save the state of a systemd |
Scope | .scope | Use systemd external bus interface creation process programmatically |
Slice | .slice | Describes a set of management processes through the living Cgroup levels of the organization |
Target | .target | Describe a group of cells systemd |
The run-level response Systemd goals:
Run Level | Systemd的target | Explanation |
---|---|---|
0 | target | Off, when using this level will host closed |
1 | rescue.target | Single-user mode, no password is required to log verification system, used for system maintenance |
2 | multi-user.target | User-defined / domain-specific run level. The default is equivalent to 3 |
3 | multi-user.target | Full multi-user mode interface characters, most of the server host is running at twice the level |
4 | multi-user.target | User-defined / domain-specific run level. The default is equivalent to 3 |
5 | graphical.target | Multi-user mode graphical interface provides a graphical desktop environment |
6 | reboot. target | Reboot, reboot the host will use this level |
Repair MBR sector failure
cause of issue
- Viruses, and other damage caused by ***
- Incorrect partitioning, disk read and write misuse
Symptom - To find a boot program, start interrupt
- Unable to load the operating system, a black screen after boot
Solutions - You should make a backup file in advance
- In CD-ROM boot into emergency mode
- Restore from a backup file
Repair GRUB boot failure
cause of issue
- GRUB boot loader in the MBR is destroyed
- grub.conf file is missing, the boot configuration error
Symptom - System boot stagnation, display "grub>" prompt
Solutions - Try to manually enter the boot command
- Enter emergency mode, rewritten or restored from a backup grub.conf
- Grub program to rebuild MBR sector
Forget the root password
cause of issue
- Forgotten root password
Symptom - You can not require root privileges management operations
- If there is no other available accounts, you can not log into the system
Solutions - Enter emergency mode, reset your password
Service Control System
Service Control System
- Common ways: sysytemctl control type the name of the service
control type - start: Start
- stop: Stops
- restart: restart (stop and then start)
- reload: reload (refresh the configuration file)
- status: check the service status
Run level of Linux systems
Checking runlevels:
- runlevel command
- systemctl tool
temporarily switch run levels: - init command
- systemctl Tools
Optimization of the startup process
System service management tools
ntsysv tool (pseudo-terminal)
- Providing an interactive visualization window
- You can run on an ASCII terminal.
- Several easy to manage multiple service
systemctl tools - It does not provide an interactive visualization window
- Single service management more efficient
Startup and control system services
View the status of system services start
- systemctl is-enabled service names
set the startup state of the system services - systemctl enable / dasable server name