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

The method of checking the status of Service in linux

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

Share

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

First, use the process to view

Use the command:

Ps-aux | grep xxx

You can check whether a process or service exists.

Second, using 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

Third, using chkconfig configuration tool

(there is no chkconfig command in Ubuntu, so you can use update-rc.d instead. The update-rc.d command on a Ubuntu or Debian system is a script that updates the startup items of the system. 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 you know the update-rc.d command, what you need to know is the main startup steps of the Linux system, as well as the run level 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 enable the service status:

Chkconfig-level 345 nscd off/on

4. Increase services:

Chkconfig-add xxx

(note: service scripts must be stored in the / etc/init.d/ directory)

For example, 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.) this will start as a system service.

5. Delete the service:

Chkconfig-del XXX

Runlevel looks at the current level.

Note: the runlevel is the functional level at which the operating system is running.

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:

These are the details of how to view the service status in linux. Please pay attention to other related articles for more information.

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