Quote:
Originally Posted by bellotranzi
For exampleif I want to check if there is mysql
# ps -ef | grep mysqld
|
There are better ways to check if mysqld is running (or any service):
Code:
$ /etc/init.d/mysql status
or
Code:
$ service mysql status
(depending on your distribution)
Or test for the pid file:
Code:
$ test -e /var/run/mysqld/mysqld.pid
(exact path depends on destribution and maybe on version)
You could also check the output of netstat for the port mysql listens to, but this would be less clean and future-proof.