I have installed mysql-5.0.45 via source. My parameters in ./configure is

--prefix=/usr/local/mysql --localstatedir=/data/mysql/data --with-unix-socket-path=/data/mysql

Then I copy the mysql.server at support-files and place in the init.d dir and rename as mysqld.

I edit mysqld and remove the backticks at @HOSTNAME@ due to the error @HOSTNAME@: command not found

And now the only error encountered when starting is:

[root@smtp01 mysql]# /etc/init.d/mysql start
Starting MySQL/etc/init.d/mysql: line 159: kill: (935) - No such process
[FAILED]

I check the line 159 and cannot find any thing related to the error. Here is the snippet:

kill -0 $2 || break # if the program goes away, stop waiting

Please advise. I can start the mysql via command line /usr/local/mysql/bin/mysqld_safe --user=mysql &.

Take note that there is no error when shutting down mysql. Error only occur when starting mysql via script