Ensim MySQL connection problems in high security mode

Hello, if you use a site with high security settings, the site's services are chrooted to the virtual file system. Usually the mysql socket file is hardlinked inside the virtual site but in my case this stopped working once and the socket is not linked correctly, resulting in the website not finding the database server.

Now there are several workarounds for that:

  1. Do NOT use localhost to connect but use localhost.localdomain or 127.0.0.1
  2. edit your /etc/init.d/mysqld script and add following line(s) just before the "return $ret" line in the start() section:

    for dir in `ls -d /home/virtual/site*`;
        do rm -f $dir/fst/var/lib/mysql/mysql.sock;
        ln $socketfile $dir/fst/var/lib/mysql/mysql.sock 2> /dev/null;
    done