Linux daemon & mysqld

Source: Internet
Author: User
Not strictly speaking, daemon is a service and can be divided into two categories:
① Stand alone
② Super daemon
Not strictly speaking, the corresponding port of the service, that... That, daemon corresponds to the port ...?

We can query their mappings from/etc/services:

 
/* The first column is the name of daemon, and the second column is port */[root @ odd ~] # Cat/etc/services | grep-I -- color = auto 'mysql' MySQL 3306/tcp # mysqlmysql 3306/udp # mysqlmysql-cluster 1186/tcp # MySQL cluster managermysql-cluster 1186 /udp # MySQL cluster managermysql-im 2273/tcp # MySQL instance managermysql-im 2273/udp # MySQL instance Manager


The main differences between the two are:
● Stand alone:Always open connection
● Super daemon:Establish a connection only when there is a request 

 
[MySQL @ odd ~] $ Mysqld_safe & [1] 5230 [MySQL @ odd ~] $130610 14:40:14 mysqld_safe logging to '/home/MySQL/log/alert. log '. 130610 14:40:14 mysqld_safe starting mysqld daemon with databases from/home/MySQL/data [root @ odd ~] # Netstat-lntp | grep: 3306tcp 0 0 ::: 3306 ::: * Listen 5550/mysqld


Therefore, it can be determined that mysqld belongs to stand alone.

In general, the mysqld STARTUP script is in the/etc/init. d/directory, PS: in fact, most daemon startup scripts are in this
In addition, the PID file of mysqld is generally in the/var/run/directory. However, I am a custom source code compilation file, and my PID file is under the datadir directory.



By David Lin

2013-06-10

Good luck

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.