In my server I noticed that I have mysqld and mysqld_safe processes running simultaneously. Is mysqld_safe supposed to run always, together with mysqld?
1 Answer
It is best that does. If you read the the code for mysqld_safe, there is basic startup initialization in the beginning and an indefinite loop at the bottom. Here is the pseudocode description of the Loop
Start the Loop
- run mysqld inside the loop
- once mysqld terminates, check for how terrmination occurred
- if normally terminated, exit loop (such as
service mysql stop
) - if abnormally terminated on startup, exit loop (errmsg posted in error file)
- if abnormally terminated otherwise, errmsg posted why mysqld died
- if normally terminated, exit loop (such as
- retry mysqld
End of Loop
This is an oversimplified description of what mysqld_safe does