Page 1 of 1

A few questions

Posted: Sat Nov 10, 2007 5:44 pm
by alex.barylski
1) Why are there several instances of daemons running? I recall reading that Linux doesn't distinguish between processes and threads like Windows, so are each child process of say, MySQL a thread handling some other task?

2) When I execute a PS -AUX I get a listing of current processes, which I have noticed each can then be invoked or queried at the command prompt, with something like this:

Code: Select all

mysql -v
What really confused me though, is that after the mysql daemon was running I was (after searching google) capable of running other mysql daemons, such as mysqladmin however that daemon was not registered or listed in the PS command above.

So I ask, when a daemon like MySQL is run, does it change the environment variables so that mysqladmin is actually loaded from anywhere as opposed to having to manually track down it's physical location, with something like:

Code: Select all

/opt/mysql/mysqladmin
Where did the mysqladmin come from?

3) I installed mysql5 via apt-get, with something like:

Code: Select all

apt-get install mysql-server
Worked like a charm but I couldn't login to phpMyAdmin so I figured I would reinstall mysql and PMA so I purged mysql with the opposite install command:

Code: Select all

apt-get --purge remove mysql-server
When I rebooted the system however and I ran PS I seen mysql daemons were *still* running... :(

I Googled and found someone advising that I run:

Code: Select all

apt-get --purge remove mysql-server-5.0
This seems to have done the trick...

Why did I have to add the -5.0 postfix when I installed it without??? How can I avoid similar problems in the future?

Thanks :)

Posted: Sun Nov 11, 2007 8:20 pm
by VladSun
1) The daemon is only one - it just forks several child processes (threads) to handle the incoming requests. Another important thing is that every child is been SUID-ed as none privileged user.

2) You can execute "ps -afux" and you will see the process tree.
mysqladmin is not a daemon - it's "A utility for performing administrative operations" (man mysqladmin :) )

3) Package managing software tools are not perfect :)

Code: Select all

apt-cache search mysql | grep server
contains:

Code: Select all

mysql-server - mysql database server (meta package depending on the latest version)
Maybe you installed mysql4... I don't know :)