In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "what are the ways to view Linux system services". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the ways to view Linux system services?"
Systemd system Services View for Centos/RHEL 7.x
Starting from CentOS 7.x, CentOS began to use systemd services instead of daemon. The original commands related to managing system startup and management system services were all replaced by systemctl commands.
Systemctl list-unit-files
The output of the command is as follows:
To view all running systemd services, you can run the following command:
Systemctl | more
The output of the command is as follows:
In addition, you can also use the following command:
Systemctl list-units-type service
The output of the command is as follows:
If you want to search for a specific service in the results, you can use pipes and the grep command.
Systemctl | grep "apache2"
The output of the command is as follows:
Use the netstat command to view system services
The Netstat command is used to check active network connections, interface statistical analysis, and routing table status. This command is available in all Linux distributions, and we will then use it to view the system services.
View services and the ports they listen on:
Netstat-pnltu
The output of the command is as follows:
View system services through the system service profile
The configuration file for the service is / etc/services is an ASCII file that contains a range of services that the user program might use. This file includes the service name, port number, protocol used, and some aliases.
For this file, we can use any text tool, such as vim:
Vim / etc/services
The output of the command is as follows:
View systemd service status
In some new versions of Linux systems, some have replaced the init process with systemd. In such a system, how to check the system service? We can use the following syntax:
Systemctl status service_name
For example, to see if the OpenSSH on your system is running, you can run:
Systemctl status sshd
The output of the command is as follows:
Alternatively, you can use the following command format to see if a service is running:
Systemctl is-active service_name
If you use this command, the corresponding command to implement the above example is:
Systemctl is-active sshd
The output of the command is as follows:
At the same time, you can also check whether a service has been enabled by using the following command:
Systemctl is-enabled service_name
For example, to check whether the OpenSSH service has been enabled, you might enter the following command:
Systemctl is-enabled sshd
The output of the command is as follows:
View the service status of previous versions
In fact, it can not be said that in the early days, there are still many such systems, on which the SysV init process is running. For this type of system, the command to view the service status is:
Service service_name status
It is also an example of viewing the OpenSSH status. The corresponding command is:
Service sshd status
The output of the command is as follows:
You can also use the following command to view all service status:
Chkconfig-list
The output of the command is as follows:
At this point, I believe you have a deeper understanding of "what are the methods of viewing Linux system services?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.