How to see if a process/service is started

Source: Internet
Author: User

We generally need to understand the state of our processes under Linux.
Let's take MySQL for example

Service MYSQLD Status

[Root@vm_57_70_centos ~]# service mysqld status;
MYSQLD (PID  17239) is running
... [Root@vm_57_70_centos ~]# 

I am here to start the state, you can see the PID

Chkconfig–list + your Service

[Root@vm_57_70_centos ~]# chkconfig--list mysqld;
Mysqld          0:off   1:off   2:on    3:on    4:on 5:on 6:off

Can see is started, there is on state

Pidof + your Service

[Root@vm_57_70_centos ~]# pidof mysqld
17239
[Root@vm_57_70_centos ~]# 

Can see the PID, description, at this time, the MySQL service is running, if not run, there is no output

Ps-ef | grep + your Service

Can be viewed through NETSTAT-TANP

If there is, there will be MySQL on the top of this article

OK, here are a few common ways to view the process and choose one that you like.

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.