Linux System Study Notes: Running System

Source: Internet
Author: User

Linux System Study Notes: running the system boot guide is to start the computer. The operating system cannot be used when the computer is started. It must be started by the boot program. During the boot process, the kernel is loaded into the memory and started to execute various initialization operations. Then the system can use it. Boot includes automatic boot and manual boot. During automatic boot, the system executes all the boot processes on its own. Manual guidance gives control to the user at a certain time. The computer is in single-user mode, and other users cannot log on to the system. The boot process can be divided into: loading and initializing the kernel. Detect and configure devices. Create a kernel process. Operator intervention (during Manual guidance ). Run the system startup script. Run in multi-user mode. The Linux kernel is usually/vmlinuz, which is linked to/boot/vmlinuz-2.6.32-5-686 On Debian [1. The system first loads it into the memory during boot. The kernel executes memory detection to determine available RAM, and then allocates the memory volume in static mode. Next, the kernel searches for and initializes the devices in the kernel. After the basic Initialization is complete, the kernel will create some spontaneous processes in the user space, because they are not created through the fork mechanism. You can use the ps-Af command to view the information, which is enclosed in brackets. After the spontaneous process is created, the kernel is finished, and the next task is completed by the init process. If guided in single-user mode, the system enters a Special Logon mode. Enter the root password to enter a root shell. You can also press ^ D to skip the single-user mode and continue the boot. Next, execute the system startup script in a certain order. If a graphical interface is installed and a graphical logon system is set, it will enter and wait for the user to log on. When a computer starts, it first loads the MBR starting with the disk. It is a 512-byte segment, which tells the computer where to boot and loads the boot loader. Then, the boot loader is responsible for loading the kernel. Currently, GRUB is the most commonly used boot loader in Linux, and LILO was used in the past, but it is not as powerful as GRUB and is rarely used now. Startup scripts are shell scripts. Different Linux systems have different ways of organizing them. Generally, the startup script sets the computer name. Set the time zone. Use fsck to check disks. Install the system disk. Delete old files from/tmp. Configure the network. Start the daemon process and network service. If the file system is uninstalled normally, The fsck check is automatically skipped. Init defines 7 running levels: 0 to the system shutdown level. Level 1 is the single-user mode level. Level 2-5 is the multi-user mode level. Level 6 is the reboot level. Level 0 and level 6 are special. The system cannot stay in these two levels. Most systems run at Level 2 or level 3. The/etc/inittab defines what init should do at each running level, that is, the command to be run at each level. The default running level of Debian is 2, which can be modified. Id: 2: initdefault: You can use the telinit command to enter a specific running level. The STARTUP script is placed under/etc/init. d/. These scripts can be run using the start and stop parameters, and some support restart. When the system starts the script, it does not directly find it in this path, but searches for/etc/rcN. d/(the level of N is 0-6 ). /Etc/rcN. d/contains the symbolic links to the startup script. They all start with S or K. When init is transitioned from low to high by running level, run the script with the start parameter at each level starting with S. During the transition from high to low, run the script with the stop parameter at each level starting with K. Debian configuration information is scattered. The Host Name of the system is in/etc/hostname, and the network interface and default gateway are in/etc/network/interfaces. Debian has a launch script hypervisor update-rc.d. Shutdown is the most perfect way to stop or reboot the system. You can specify a time and an optional Message notification for shutdown. Use-h and-r to specify whether to stop or reboot, and use-F or-f to force or skip The fsck check. Shutdown-h calls the halt command, which can also be used independently to execute the basic task of shutting down the system. Halt will execute the sync system call. You can use the-n option to not execute sync, which is mainly used after fsck repair. Shutdown-r calls the reboot command, which is similar to halt. The difference is that it restarts the machine and supports the-n option. The poweroff command is equivalent to halt, but it also requests to turn off the main power (on a system with this function ).
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.