This file is indexed.

/usr/share/mysql/mysql-systemd-start is in percona-xtradb-cluster-server-5.7 5.7.20-29.24-0ubuntu2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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

# tokudb specific
#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
#}

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


	if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
	then
                install -d -m 0750 -o mysql -g mysql ${MYSQLDATA}/mysql
	fi

	if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
	then
		su - mysql -s /bin/bash -c "/usr/sbin/mysqld --initialize-insecure=on 2>&1 > /dev/null"
		su - mysql -s /bin/bash -c "/usr/sbin/mysqld --log_error_verbosity=2 2>&1 > /dev/null &"
		pinger
		mysql -e "INSTALL PLUGIN auth_socket SONAME 'auth_socket.so'"
		mysql -e "USE mysql; UPDATE user SET plugin='auth_socket' WHERE user='root'"
		mysqladmin shutdown
	fi

	if [ -x /usr/bin/mysql_ssl_rsa_setup -a ! -e "${MYSQLDATA}/server-key.pem" ];
	then
		/usr/bin/mysql_ssl_rsa_setup --datadir="${MYSQLDATA}" --uid=mysql >/dev/null 2>&1
	fi

	if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
	then
                install -d -m 0750 -o mysql -g adm ${MYSQLLOG}
		install -m 0640 -o mysql -g adm /dev/null ${MYSQLLOG}/error.log
	fi

	if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
	then
                install -d -m 0755 -o mysql -g mysql ${MYSQLRUN} 
	fi

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

	# Needed because of TokuDB
	#fix_thp_setting
}

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