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