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

What are the new changes in RHEL/CentOS 7.x

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces the new changes of RHEL/CentOS 7.x. It is very detailed and has certain reference value. If you are interested, you must finish it.

1. Services of CentOS uses systemd instead of sysvinit management

1. Systemd's service management program:

Systemctl is the main tool that combines the previous functions of service and chkconfig. You can use it to enable / disable services only in the current session.

Systemctl can list the running service status, as shown in the figure:

Systemd-cgls lists the running processes in a tree, and it recursively displays the contents of the control group. As shown in the figure:

2. How to start / shut down, enable / disable services?

Start a service: systemctl start postfix.service

Shut down a service: systemctl stop postfix.service

Restart a service: systemctl restart postfix.service

Displays the status of a service: systemctl status postfix.service

Enable a service at boot time: systemctl enable postfix.service

Disable one service at boot time: systemctl disable postfix.service

Check to see if the service starts up: systemctl is-enabled postfix.service;echo $?

View the list of started services: systemctl list-unit-files | grep enabled

Note: to enable a service is to establish a soft link to the corresponding service profile in the current "runlevel" configuration file directory / etc/systemd/system/multi-user.target.wants/; to disable the service is to delete the soft link. As shown in the figure:

Looking at the files in / usr/lib/systemd/system, the syntax is completely different from the system service script in the old version / etc/init.d/.

Second, modify the running level of the system:

1. Systemd uses target, which is freer than the run-level of sysvinit. The third runner is replaced by multi-user.target. The fifth runner is replaced by graphical.target. Runlevel3.target and runlevel5.target are symbolic links to multi-user.target and graphical.target, respectively.

You can switch to runlevel 3 using the following command:

Systemctl isolate multi-user.target or systemctl isolate runlevel3.target

You can switch to runlevel 5 using the following command:

Systemctl isolate graphical.target or systemctl isolate runlevel5.target

2. How to change the default run level?

Systemd uses links to point to the default run level. Before creating a new link, you can delete the existing link with the following command: rm / etc/systemd/system/default.target

Start runlevel 3 by default:

Ln-sf / lib/systemd/system/multi-user.target / etc/systemd/system/default.target

Start runlevel 5 by default:

Ln-sf / lib/systemd/system/graphical.target/etc/systemd/system/default.target

Systemd does not use the / etc/inittab file.

3. How do I view the current runlevel?

The old runlevel command can still be used under systemd. You can continue to use it, although systemd replaces the runlevel of the previous system with the concept of 'target' (multiple' target' can be activated at the same time).

The equivalent systemd command is systemctl list-units-type=target

3. Other configuration tools:

1. Setup and ntsysv tools are still retained, but their functions have been greatly weakened. In the past, ntsysv tools can control the self-startup of all system services, but now they can only control a small number of services.

2. / etc/resolv.conf the DNS configuration file has not changed.

3. / etc/sysconfig/network-scripts/ifcfg-ens192 network card configuration file name and some options have been changed.

4, boot mode to use grub2 boot, grub2 has the following characteristics: 1, modular design; 2, support multi-system hardware architecture; 3, support international multi-language; 4, independent memory management; 5, support script language.

Attached: brief introduction of systemd

Systemd is a kind of init software under Linux, which is developed by Lennart Poettering and released under the license of LGPL 2.1 and subsequent versions. Its development goal is to provide a better framework to express the dependency relationship between system services, and to realize the parallel startup of services during system initialization, at the same time, to reduce the system overhead of Shell, and finally replace the commonly used System V and BSD style init programs.

Compared to the System V-style init used by most distributions, systemd adopts the following new technologies:

Adopt Socket-activated and bus-activated services to improve the parallel performance of interdependent services

Use cgroups instead of PID to track progress, so that even daemons generated after two fork are not out of the control of systemd.

Conceptually, because systemd uses components such as cgroup and fanotify to implement its features, it is only applicable to Linux.

These are all the contents of this article entitled "what are the New changes in RHEL/CentOS 7.x?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Internet Technology

Wechat

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

12
Report