How to Check Running Services Linux? Linux Command

Source: Internet
Author: User
Keywords linux running services check running services linux how to check if a service is running linux

check linux running services

Alibaba Cloud Simple Application Server:  Anti COVID-19 SME Enablement Program
$300 coupon package for all new SMEs and a $500 coupon for paying customers.
 

1. First check the running process of the system
 If you need to check all the processes currently running on the system, you need to use the following command:
 
  # ps auxw
 
The parameter a represents the process of displaying all users in the system; u represents the information that the user belongs to the output process; x represents also
displays processes without a console; if the display line is too long and is truncated, you can use the f parameter;


2. Check the services monitored by the system

  # netstat -ln


L means that the current system monitors the port information; n means that the port is displayed according to the port number, not converted to
 
The port name defined in the service file; if you want to know which processes are listening for each port, you can use the p parameter.
 If you find unneeded services, you can use the linuxconf or ntsysv command to turn off these services automatically when the system starts
 start, and then restart the system, these services will be running.
 Some services are monitored by the inetd  super server, you need to mark /etc/inetd.conf to disable these services.
 

3. check the IP address of the access server

last can check the users and IPs that have logged in before

w check current user


Instruction:
What the computer can actually do is very simple in nature, such as calculating the sum of two numbers, or finding an address in memory, etc. These most basic computer actions are called instructions.

Program:
A set of such a series of instructions. Through the program, we can let the computer complete complex operations. Programs are stored as executable files most of the time. Such an executable file is like a recipe, and the computer can make delicious meals according to the recipe.

Process:
The process is a concrete realization of the program. Only when the recipe is useless, we must follow the instructions of the recipe and implement it step by step in order to make the dishes. The process is the process of executing the program, similar to the process of actually cooking according to the recipe. The same program can be executed multiple times, and an independent space can be opened in the memory to load each time, thereby generating multiple processes. Different processes can also have their own independent IO interfaces.
You can use the $ps command to query the running process;

Parameters: There are many parameters of ps, here only a few commonly used parameters are listed and the meaning is roughly introduced
-A lists all processes (equivalent to -e)
-w display widening can display more information
-au display more detailed information
-aux show all itineraries that include other users
Service
The service is equivalent to some necessary programs that support the operation of the system. It runs silently in the background of the system. It can provide some more distinctive things for the application, such as playing MP3, opening a service for playing MP3, and the user clicks the start button to notify the service to start. Click the close button to notify the service to close. If you disable this service, it won't work for others to play MP3, and the services may depend on each other.
Services and processes?
Someone replied: There will be a process corresponding to which service in which service task manager you open;
Some people say that a service is a collection of processes that are started in accordance with the service startup mode every time an opportunity is opened, and a service may include many processes. And the processes started may be mutually overlapping.
linux view service:
One, use the process to view
In the command, ps -aux | grep xxx is to check whether a certain process or service exists.
Second, use the services command
1. View the running status of a single service:
service service name status
Such as: [root@localhost ~]# service sshd status
openssh-daemon (pid 3701) is running...
2. View the running status of all services:
service –status -all
Three, use the chkconfig configuration tool (have not tried)
(There is no chkconfig command in Ubuntu, you can use update-rc.d instead.
The update-rc.d command in Ubuntu or Debian system is a script used to update system startup items. The links to these scripts are located in the /etc/rcN.d/ directory, and the corresponding scripts are located in the /etc/init.d/ directory. Before understanding the update-rc.d command, what you need to know is the main startup steps of the Linux system and the knowledge of run levels in Ubuntu. )
1. View the running status of a single service:
chkconfig service name status
2. View the running status of all services
chkconfig –list
3. Turn off or turn on the service status:
chkconfig –level 345 nscd off/on
3. Turn off or turn on the service status:
chkconfig –level 345 nscd off/on
4. Increase service:
chkconfig –add xxx (Note: The service script must be stored in the /etc/init.d/ directory)
Such as mysqld
[root@www mysql-5.1.59]#cp support-files/mysql.server etc/init.d/mysqld
chkconfig mysqld on (each level is ON, each level is 2345 level)
This will start as a system service
5. Delete service:
chkconfig –del XXX
runlevel View the current level.
Note: The run level is the functional level at which the operating system is running.

Related Article

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.