Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Brief introduction of RHEL7 running level and how to switch operation

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

RHEL7 operating level introduction and how to switch operation, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Init is one of the indispensable programs in the operation of Linux system. The init process, which is a user-level process started by the kernel. The kernel will look for it in several places where init has been used in the past, and its correct location (for Linux systems) is / sbin/init. If the kernel cannot find init, it will try to run / bin/sh, and if it fails, the startup of the system will fail.

7 run levels of Linux system

0: shutdown, shutdown mode

1: single user mode

2: multi-user mode

3: complete multi-user text mode

4: the system is not in use, so it is generally not used for retention.

5: graphical mode

6: restart mode

The runtime level is the functional level at which the operating system is currently running. This level ranges from 0 to 6 and has different functions.

Level specific description:

0: system shutdown (shutdown) mode, the default running level of the system cannot be set to 0, otherwise it cannot be started normally, and it will shut down automatically as soon as it is turned on.

1: single-user mode, root permission, for system maintenance, prohibit remote login, just like the secure mode login under Windows.

2: multi-user mode, no NFS network support.

3: complete multi-user text mode, with NFS, log in to the console command line mode.

4: the system is not in use, it is generally not used, and it can be used to do something in some special cases. For example, when the laptop battery runs out, you can switch to this mode to make some settings.

5: graphical mode, enter graphical GUI mode or GNOME, KDE graphical interface after login, such as X Window system.

6: restart mode, the default running level cannot be set to 6, otherwise it cannot be started normally, it will always boot and restart.

Introduction to the startup principle:

1. There are many server scripts under the directory / etc/rc.d/init.d, which are generally called service.

[root@Jaking] # ls-l / etc/rc.d/init.dtotal 40 RWMI / RWMI / RW / RW / r / RW / RW / RW-l / RW-l / RW-r-r-M-R-R 1 root root 15131 Sep 12 2016 functions-rwxr-xr-x. 1 root root 2989 Sep 12 2016 netconsole-rwxr-xr-x. 1 root root 6643 Sep 12 2016 network-rwxr-xr-x. 1 root root 2190 May 31 02:09 nginx-rw-r--r--. 1 root root 1160 Sep 13 2016 README-rwxr-xr-x. 1 root root 2437 Jun 26 2015 rhnsd

2. Under / etc/rc.d, there are seven directories called rcN.d, corresponding to the seven run levels of the system (0-6).

[root@Jaking] # ls-l / etc/rc.dtotal 36drwxr-xr-x. 2 root root 4096 May 31 02:09 init.ddrwxr-xr-x. 2 root root 4096 May 30 11:46 rc0.ddrwxr-xr-x. 2 root root 4096 May 30 11:46 rc1.ddrwxr-xr-x. 2 root root 4096 May 31 05:00 rc2.ddrwxr-xr-x. 2 root root 4096 May 31 05:00 rc3.ddrwxr-xr-x. 2 root root 4096 May 31 05:00 rc4.ddrwxr-xr-x. 2 root root 4096 May 31 05:00 rc5.ddrwxr-xr-x. 2 root root 4096 May 30 11:46 rc6.d-rw-r--r--. 1 root root 473 Sep 13 2016 rc.local

Note:

Minimized installed operating systems do not have graphical software by default

The method of installing graphical software is as follows

Yum install-y xorg* gnome* glx*

RHEL7 changes the default startup level

[root@Jaking ~] # systemctl get-default graphical.target is launched by default to multi-user character interface: [root@Jaking ~] # systemctl set-default multi-user.target rm'/ etc/systemd/system/default.target'ln-s'/ usr/lib/systemd/system/multi-user.target''/ etc/systemd/system/default.target' to view the operation mode of default startup: [root@Jaking ~] # systemctl get-default multi-user.target word The character mode is enabled by default to multi-user graphical interface: [root@Jaking ~] # systemctl set-default graphical.target rm'/ etc/systemd/system/default.target'ln-s'/ usr/lib/systemd/system/graphical.target''/ etc/systemd/system/default.target' to see the default running mode: [root@Jaking ~] # systemctl get-default graphical.target graphical mode changes from character interface to graphical interface: Method 1: execute startx method 2: execute systemctl isolate graphical.target method 3: execute init 5 to read the above content Have you mastered the brief introduction of RHEL7 runlevel and how to switch operation? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report