In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What are the runlevels in CentOS? In response to this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
1. Linux operating level:
1)0: shutdown
2)1: Single user
3)2: Multi-user state No network service
4)3: Multi-user status with network services
5)4: System unused reserved for users
6)5: Graphical interface
7)6: System restart
Note: Common runlevels are 3 and 5. To modify the runlevel, you can change the number in id: 5: initdefault in/etc/inittab.
2. Solution to Forgetting Root Password:
When the machine starts, enter the grub boot program, press e, then select the line with label=(usually the second line), then click an e, enter a 1,(that is, the running level is changed to 1) and then enter, you can enter the stand-alone mode, and then restart, you can modify the original configuration file.
3.Linux boot process:
1)BIOS loading, when you turn on the computer power, the computer will first load BIOS information, BIOS contains CPU related information, device boot sequence information, hard disk information, memory information, PnP characteristics and so on. So the computer knows which hardware device to read.
2)Read MBR, as we all know, the first sector of track 0 of the disk is called MBR(Master Boot Record), that is, the master boot record, its size is 512 bytes, there are pre-boot information, partition table information. After the system finds the MBR specified by BIOS, it will copy it to the physical memory where the address 0X7c00 is located. The contents of memory are Boot Loader, and specific to your computer, that is lilo or grub.
3)Boot Loader: Mini programs that run before the operating system kernel. Mini programs are usually used to initialize hardware devices, map memory space, and bring the system's hardware and software environments to a suitable state for eventual calls to the operating system kernel. There are several types of Boot Loader, the most common of which are Grub, Lilo and spfdisk. For example, grub, the system will read the grub configuration information in memory (usually menu.lst, or grub.lst), and start different operating systems according to this configuration information.
4)Loading kernel: According to the path of kernel image set by grub, the system reads memory image and decompresses it. At this point, the screen usually outputs the prompt "Uncompressing Linux." When decompressing the kernel is complete, the screen outputs "OK, booting the kernel." The system places the decompressed kernel in memory and calls the star_kernel() function to start a series of initialization functions and initialize various devices to complete the establishment of the Linux kernel environment. At this point, the linux kernel has been built, linux based programs should be able to run properly.
5)The user layer init sets the runlevel according to the inittab file: after the kernel is loaded, the first program to run is/sbin/init, which reads the/etc/inittab file and initializes it according to it. In fact, the main purpose of the/init/inittab file is to set the Linux runtime level, and its setting form is "id:5:initdefault:", which indicates that Linux needs to run at level 5. See 1 for operating class.
6) The init process executes rc.sysinit: After setting the runtime level, the first user layer file executed by the Linux system is/etc/rc.d/rc.sysinit script program. It does a lot of work, including setting Path, setting network configuration (/etc/sysconfig/network), starting swap partition, setting/proc, etc.
7)Start kernel module: load kernel module according to/etc/modules.conf file or files in/etc/modules.d directory.
8)Execute script programs of different running levels: according to different running sectors, the system runs corresponding script programs in rc0.d to rc6.d to complete corresponding initialization work and start corresponding services.
9)Execute/etc/rc.d/rc.local: rc.local is where linux is left for user personalization after all initialization work. You can put whatever you want to set up and activate here.
10)Run the/bin/login program and enter the login state: At this point, the system has entered the waiting time for the user to enter username and password, and you can already log in to the system with your own account.
The answers to the run-level questions in CentOS are shared here. I hope the above content can help you to some extent. If you still have a lot of doubts, you can pay attention to the industry information channel to learn more.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.