OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: mysql socket vanishes after each system halt/(re)boot

From: Stuart Henderson (stuspacehopper.org)
Date: Tue Apr 01 2008 - 09:36:55 CDT


On 2008-04-01, mufurcz <mufurcziinet.net.au> wrote:
> After every system boot I am loosing the mysql server directory from /var/run,
> ergo the socket file from /var/run/mysql.

Ugh sorry, I should have read the rest of your mail...

> # ps -aux | grep mysqld
> root 10008 0.0 0.1 644 536 C0- I 7:25AM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe
> _mysql 11507 0.0 3.2 40396 16944 C0- S 7:25AM 0:00.44 /usr/local/libexec/mysqld --basedir
>
> # cd /var/run/mysql
> ksh: cd: /var/run/mysql - No such file or directory

there is something going wrong with mysqld_safe then, because it
creates the directory to hold the socket if it doesn't already exist...

> # Make sure that directory for $safe_mysql_unix_port exists
> mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
> if [ ! -d $mysql_unix_port_dir ]
> then
> mkdir $mysql_unix_port_dir
> chown $user:$group $mysql_unix_port_dir
> chmod 711 $mysql_unix_port_dir
> fi

so...
> /usr/local/bin/mysqld_safe >/dev/null 2>&1 &

try removing the redirection to /dev/null and look for error
messages from mysqld_safe.