diff --git a/mariadb-prepare-db-dir b/mariadb-prepare-db-dir index 8762ab7..c4c333f 100644 --- a/mariadb-prepare-db-dir +++ b/mariadb-prepare-db-dir @@ -50,6 +50,16 @@ chown "$myuser:$mygroup" "$errlogfile" chmod 0640 "$errlogfile" [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" +# We check if there is already a process using the socket file, +# since otherwise this systemd service file could report false +# positive result when starting and mysqld_safe could remove +# a socket file, which actually uses a different daemon. +if fuser "$socketfile" &>/dev/null ; then + echo "Socket file $socketfile exists." >&2 + echo "Is another MySQL daemon already running with the same unix socket?" >&2 + exit 1 +fi + # Make the data directory if [ ! -d "$datadir/mysql" ] ; then # First, make sure $datadir is there with correct permissions diff --git a/mariadb.spec b/mariadb.spec index 774d429..d9ac190 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -801,6 +801,9 @@ fi Related: #1044565 - Use upstream's layout for symbols version in client library Related: #1045013 +- Check if socket file is not being used by another process at a time + of starting the service + Related: #1045435 * Wed Nov 27 2013 Honza Horak 1:5.5.34-2 - Fix mariadb-wait-ready script