403Webshell
Server IP : 103.75.185.95  /  Your IP : 216.73.217.162
Web Server : nginx/1.30.0
System : Linux cs-linux-20260509085757017 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : cuuhootoxema ( 1215)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/mysql/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/mysql/mysql-systemd-start
#!/bin/bash

# Scripts to run by Percona Server systemd service
#
# Needed argument: pre
#
# pre mode  :  try to perform sanity check for configuration, log, data

# Include helper functions
. /usr/share/mysql/mysql-helpers

fix_thp_setting() {
        THP_SETTING=$(my_print_defaults mysqld_safe | grep thp-setting | cut -d= -f2 | tail -n 1)
        if [ ! -z "${THP_SETTING}" ]; then
                # Set whatever option is specified in config file
                echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/defrag
                echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/enabled
        fi
}

my_which () {
    save_ifs="${IFS-UNSET}"
    IFS=:
    ret=0
    for file
    do
        for dir in $PATH
        do
        if [ -f "$dir/$file" ]
        then
            echo "$dir/$file"
            continue 2
        fi
        done

        ret=1  #signal an error
        break
    done

    if [ "$save_ifs" = UNSET ]
    then
        unset IFS
    else
        IFS="$save_ifs"
    fi
    return $ret  # Success
}

fix_flush_caches() {
    flush_caches=$(my_print_defaults mysqld_safe | grep flush_caches | cut -d= -f2 | tail -n 1)
    if [ ! -z ${flush_caches} ]; then
        if [ ${flush_caches} = 1 ]; then
            if [ ! $(my_which sync) ]; then
                echo "sync command not found, required for --flush-caches"
                exit 1
            # Flush file system buffers.
            else
                sync
                ret=$?
                if [ $ret -ne 0 ]; then
                    # Huh, the sync() function is always successful...
                    echo "sync failed, check if sync is properly installed"
                fi
            fi

            # Locate sysctl, ensure it exists.
            if [ ! $(my_which sysctl) ]; then
                echo "sysctl command not found, required for --flush-caches"
                exit 1
            # Purge page cache, dentries and inodes.
            else
                sysctl -q -w vm.drop_caches=3
                ret=$?
                if [ $ret -ne 0 ]; then
                    echo "sysctl failed, check the error message for details"
                    exit 1
                fi
            fi
        fi
    fi
}

sanity () {
# Make sure database and required directories exist
        verify_ready $1
        verify_database $1


        if [ ! -r /etc/mysql/my.cnf ]; then
                echo "Percona Server configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
                exit 1
        fi

        # Needed because of TokuDB
        fix_thp_setting
	fix_flush_caches
}

case $1 in
        "pre")  sanity $2 ;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit