⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.96
Server IP:
147.93.97.220
Server:
Linux srv843233 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
mysql
/
View File Name :
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