问题描述
我在执行命令#find/-name mysqld"时感到困惑.因为mysqld位于以下四个位置:
I have confusion while I'm execute the command "# find / -name mysqld". Because the mysqld is located in four places which are:
- /usr/libexec/mysqld
- /etc/rc.d/init.d/mysqld
- /var/lock/subsys/mysqld
- /var/run/mysqld
另外三个mysql守护程序的用途是什么?
What is the purpose of another three mysql daemons?
推荐答案
以下是说明
- /usr/libexec/mysqld:实际的二进制可执行文件
- /etc/rc.d/init.d/mysqld:服务启动文件(文本文件)
- /var/run/mysqld:PID/运行文件文件夹(mysqld在该文件夹中写入一个运行文件)
- /var/lock/subsys/mysqld:不确定
如果您运行which mysqld
,应该会看到第一个
If you run which mysqld
you should see the first one
您永远不会直接运行它
运行service mysqld start
时,它将调用/etc/rc.d/init.d/mysqld
以启动名为mysqld_safe
的程序(运行which mysqld_safe
). mysqld_safe
和mysqld
一起成为服务器守护程序.
When you run service mysqld start
, it calls /etc/rc.d/init.d/mysqld
to kickoff a program called mysqld_safe
(Run which mysqld_safe
). mysqld_safe
and mysqld
work together to be the server daemon.
依次,mysqld_safe
将启动mysqld,然后检查退出代码.您可以运行less /etc/rc.d/init.d/mysqld
并看到它.如果mysqld由于系统关闭或正常service mysql stop
而没有结束,则mysqld_safe将尝试重新启动mysqld
.
In turn, mysqld_safe
will kickoff mysqld and then checks for an exit code. You can run less /etc/rc.d/init.d/mysqld
and see this. If mysqld did not end due to system shutdown or a normal service mysql stop
, mysqld_safe will attempt to restart mysqld
.
这篇关于为什么mysqld在linux系统中位于4个地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!