SOURCES: mysql.init - avoid creating mysql.sock symlink if there a...

glen glen at pld-linux.org
Fri Jul 14 15:04:01 CEST 2006


Author: glen                         Date: Fri Jul 14 13:04:01 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- avoid creating mysql.sock symlink if there already exists one (even dead symlink).
- (anyone can make it simplier?)

---- Files affected:
SOURCES:
   mysql.init (1.96 -> 1.97) 

---- Diffs:

================================================================
Index: SOURCES/mysql.init
diff -u SOURCES/mysql.init:1.96 SOURCES/mysql.init:1.97
--- SOURCES/mysql.init:1.96	Wed Jul  5 11:58:17 2006
+++ SOURCES/mysql.init	Fri Jul 14 15:03:55 2006
@@ -734,7 +734,7 @@
 	    chmod 640 "$MYSQL_CLUSTER_DIR/mysqld.conf"
 	fi
 
-	if [ ! -e /var/lib/mysql/mysql.sock ]; then
+	if [ ! -e /var/lib/mysql/mysql.sock ] || [ -L /var/lib/mysql/mysql.sock ] && [ -z "$(readlink /var/lib/mysql/mysql.sock)" ]; then
 		sock=$(echo "$MYSQL_SOCKET" | sed -e 's,^/var/lib/mysql/,,')
 	    ln -s "$sock" /var/lib/mysql/mysql.sock
 	fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/mysql.init?r1=1.96&r2=1.97&f=u



More information about the pld-cvs-commit mailing list