rename mysql scripts to mariadb

Use mariadb names in the scripts too.

Cherry-picked from Fedora: df76620f9e
Related: #1971248
This commit is contained in:
Daniel Black 2021-04-21 18:30:46 +10:00 committed by Michal Schorm
parent b731fafd7a
commit 80862e14ea
10 changed files with 55 additions and 55 deletions

View File

@ -5,7 +5,7 @@
# positive result when starting and mysqld_safe could remove # positive result when starting and mysqld_safe could remove
# a socket file, which is actually being used by a different daemon. # a socket file, which is actually being used by a different daemon.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common"
if test -e "$socketfile" ; then if test -e "$socketfile" ; then
echo "Socket file $socketfile exists." >&2 echo "Socket file $socketfile exists." >&2
@ -25,9 +25,9 @@ if test -e "$socketfile" ; then
fi fi
# some process uses the socket file # some process uses the socket file
response=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER --connect-timeout="${CHECKSOCKETTIMEOUT:-10}" ping 2>&1` response=`@bindir@/mariadb-admin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER --connect-timeout="${CHECKSOCKETTIMEOUT:-10}" ping 2>&1`
if [ $? -eq 0 ] || echo "$response" | grep -q "Access denied for user" ; then if [ $? -eq 0 ] || echo "$response" | grep -q "Access denied for user" ; then
echo "Is another MySQL daemon already running with the same unix socket?" >&2 echo "Is another MariaDB daemon already running with the same unix socket?" >&2
echo "Please, stop the process using the socket $socketfile or remove the file manually to start the service." >&2 echo "Please, stop the process using the socket $socketfile or remove the file manually to start the service." >&2
exit 1 exit 1
fi fi

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common"
upgrade_info_file="$datadir/mysql_upgrade_info" upgrade_info_file="$datadir/mysql_upgrade_info"
version=0 version=0
@ -25,14 +25,14 @@ if [ $version -ne $thisversion ] ; then
fi fi
cat <<EOF >&2 cat <<EOF >&2
The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps: The datadir located at $datadir needs to be upgraded using 'mariadb-upgrade' tool. This can be done using the following steps:
1. Back-up your data before with 'mysql_upgrade' 1. Back-up your data before with 'mariadb-upgrade'
2. Start the database daemon using 'service @DAEMON_NAME@ start' 2. Start the database daemon using 'systemctl start @DAEMON_NAME@.service'
3. Run 'mysql_upgrade' with a database user that has sufficient privileges 3. Run 'mariadb-upgrade' with a database user that has sufficient privileges
Read more about 'mysql_upgrade' usage at: Read more about 'mariadb-upgrade' usage at:
https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/ https://mariadb.com/kb/en/mysql_upgrade/
EOF EOF
fi fi

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# This script creates the mysql data directory during first service start. # This script creates the MariaDB data directory during first service start.
# In subsequent starts, it does nothing much. # In subsequent starts, it does nothing much.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common"
export LC_ALL=C export LC_ALL=C
@ -97,7 +97,7 @@ if should_initialize "$datadir" ; then
# https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19 # https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19
INITDB_TIMESTAMP=`LANG=C date -u` INITDB_TIMESTAMP=`LANG=C date -u`
sleep 1 sleep 1
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" --skip-test-db >&2 @bindir@/mariadb-install-db --rpm --datadir="$datadir" --user="$myuser" --skip-test-db >&2
ret=$? ret=$?
if [ $ret -ne 0 ] ; then if [ $ret -ne 0 ] ; then
echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
# Some useful functions used in other MySQL helper scripts # Some useful functions used in other MariaDB helper scripts
# This scripts defines variables datadir, errlogfile, socketfile # This scripts defines variables datadir, errlogfile, socketfile
export LC_ALL=C export LC_ALL=C
# extract value of a MySQL option from config files # extract value of a MariaDB option from config files
# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ] # Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ]
# result is returned in $result # result is returned in $result
# We use my_print_defaults which prints all options from multiple files, # We use my_print_defaults which prints all options from multiple files,
@ -25,7 +25,7 @@ get_mysql_option(){
fi fi
} }
# For the case of running more instances via systemd, scrits that source # For the case of running more instances via systemd, scripts that source
# this file can get --default-group-suffix or similar option as the first # this file can get --default-group-suffix or similar option as the first
# argument. The utility my_print_defaults needs to use it as well, so the # argument. The utility my_print_defaults needs to use it as well, so the
# scripts sourcing this file work with the same options as the daemon. # scripts sourcing this file work with the same options as the daemon.
@ -35,17 +35,17 @@ while echo "$1" | grep -q '^--defaults' ; do
shift shift
done done
# Defaults here had better match what mysqld_safe will default to # Defaults here had better match what mariadbd-safe will default to
# The option values are generally defined on three important places # The option values are generally defined on three important places
# on the default installation: # on the default installation:
# 1) default values are hardcoded in the code of mysqld daemon or # 1) default values are hardcoded in the code of mariadbd daemon or
# mysqld_safe script # mariadbd-safe script
# 2) configurable values are defined in @sysconfdir@/my.cnf # 2) configurable values are defined in @sysconfdir@/my.cnf
# 3) default values for helper scripts are specified bellow # 3) default values for helper scripts are specified bellow
# So, in case values are defined in my.cnf, we need to get that value. # So, in case values are defined in my.cnf, we need to get that value.
# In case they are not defined in my.cnf, we need to get the same value # In case they are not defined in my.cnf, we need to get the same value
# in the daemon, as in the helper scripts. Thus, default values here # in the daemon, as in the helper scripts. Thus, default values here
# must correspond with values defined in mysqld_safe script and source # must correspond with values defined in mariadbd-safe script and source
# code itself. # code itself.
server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ client-server" server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ client-server"

View File

@ -11,13 +11,13 @@ be expanded by cmake. Cmake needs to know about them, so adding them manually.
+ +
+ # files for systemd + # files for systemd
+ SET(SYSTEMD_SCRIPTS + SET(SYSTEMD_SCRIPTS
+ mysql.tmpfiles.d + mariadb.tmpfiles.d
+ mysql.service + mysql.service
+ mysql@.service + mysql@.service
+ mysql-prepare-db-dir + mariadb-prepare-db-dir
+ mysql-check-socket + mariadb-check-socket
+ mysql-check-upgrade + mariadb-check-upgrade
+ mysql-scripts-common + mariadb-scripts-common
+ mysql_config_multilib + mysql_config_multilib
+ clustercheck + clustercheck
+ galera_new_cluster + galera_new_cluster

View File

@ -51,8 +51,8 @@ addFilter(r'incoherent-logrotate-file /etc/logrotate.d/mariadb')
addFilter(r'non-executable-in-bin /usr/bin/wsrep_sst_common 644') addFilter(r'non-executable-in-bin /usr/bin/wsrep_sst_common 644')
addFilter(r'script-without-shebang /usr/bin/wsrep_sst_common') addFilter(r'script-without-shebang /usr/bin/wsrep_sst_common')
addFilter(r'non-executable-script /usr/bin/wsrep_sst_common 644 None') addFilter(r'non-executable-script /usr/bin/wsrep_sst_common 644 None')
# mysql-scripts-common has a simmilar issue # mariadb-scripts-common has a similar issue
addFilter(r'non-executable-script /usr/libexec/mysql-scripts-common 644 /bin/sh') addFilter(r'non-executable-script /usr/libexec/mariadb-scripts-common 644 /bin/sh')
# Seems pretty standard to me ... # Seems pretty standard to me ...
addFilter(r'non-standard-dir-perm /var/log/mariadb 750') addFilter(r'non-standard-dir-perm /var/log/mariadb 750')

View File

@ -171,13 +171,13 @@ License: GPLv2 and LGPLv2
Source0: https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz Source0: https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz
Source2: mysql_config_multilib.sh Source2: mysql_config_multilib.sh
Source3: my.cnf.in Source3: my.cnf.in
Source6: README.mysql-docs Source6: README.mariadb-docs
Source10: mysql.tmpfiles.d.in Source10: mariadb.tmpfiles.d.in
Source11: mysql.service.in Source11: mysql.service.in
Source12: mysql-prepare-db-dir.sh Source12: mariadb-prepare-db-dir.sh
Source14: mysql-check-socket.sh Source14: mariadb-check-socket.sh
Source15: mysql-scripts-common.sh Source15: mariadb-scripts-common.sh
Source16: mysql-check-upgrade.sh Source16: mariadb-check-upgrade.sh
Source18: mysql@.service.in Source18: mysql@.service.in
Source50: rh-skipped-tests-base.list Source50: rh-skipped-tests-base.list
Source51: rh-skipped-tests-arm.list Source51: rh-skipped-tests-arm.list
@ -997,18 +997,18 @@ install -D -p -m 644 %{_vpath_builddir}/scripts/mysql.service %{buildroot}%{_uni
install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service
# helper scripts for service starting # helper scripts for service starting
install -p -m 755 %{_vpath_builddir}/scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir install -p -m 755 %{_vpath_builddir}/scripts/mariadb-prepare-db-dir %{buildroot}%{_libexecdir}/mariadb-prepare-db-dir
install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket install -p -m 755 %{_vpath_builddir}/scripts/mariadb-check-socket %{buildroot}%{_libexecdir}/mariadb-check-socket
install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade install -p -m 755 %{_vpath_builddir}/scripts/mariadb-check-upgrade %{buildroot}%{_libexecdir}/mariadb-check-upgrade
install -p -m 644 %{_vpath_builddir}/scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common install -p -m 644 %{_vpath_builddir}/scripts/mariadb-scripts-common %{buildroot}%{_libexecdir}/mariadb-scripts-common
# Install downstream version of tmpfiles # Install downstream version of tmpfiles
install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf install -D -p -m 0644 %{_vpath_builddir}/scripts/mariadb.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf
%if 0%{?mysqld_pid_dir:1} %if 0%{?mysqld_pid_dir:1}
echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf
%endif %endif
# install aditional galera selinux policy # install additional galera selinux policy
%if %{with galera} %if %{with galera}
install -p -m 644 -D selinux/%{name}-server-galera.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp install -p -m 644 -D selinux/%{name}-server-galera.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp
%endif %endif
@ -1526,10 +1526,10 @@ fi
%{_unitdir}/%{daemon_name}* %{_unitdir}/%{daemon_name}*
%{?with_tokudb:%exclude %{_unitdir}/mariadb.service.d/tokudb.conf} %{?with_tokudb:%exclude %{_unitdir}/mariadb.service.d/tokudb.conf}
%{_libexecdir}/mysql-prepare-db-dir %{_libexecdir}/mariadb-prepare-db-dir
%{_libexecdir}/mysql-check-socket %{_libexecdir}/mariadb-check-socket
%{_libexecdir}/mysql-check-upgrade %{_libexecdir}/mariadb-check-upgrade
%{_libexecdir}/mysql-scripts-common %{_libexecdir}/mariadb-scripts-common
%attr(0755,mysql,mysql) %dir %{pidfiledir} %attr(0755,mysql,mysql) %dir %{pidfiledir}
%attr(0755,mysql,mysql) %dir %{dbdatadir} %attr(0755,mysql,mysql) %dir %{dbdatadir}

View File

@ -26,7 +26,7 @@
[Unit] [Unit]
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
Documentation=man:mysqld(8) Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/ Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target After=network.target
@ -40,17 +40,17 @@ Type=notify
User=mysql User=mysql
Group=mysql Group=mysql
ExecStartPre=@libexecdir@/mysql-check-socket ExecStartPre=@libexecdir@/mariadb-check-socket
# '%n' expands to 'Full unit name'; man systemd.unit # '%n' expands to 'Full unit name'; man systemd.unit
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n ExecStartPre=@libexecdir@/mariadb-prepare-db-dir %n
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms, # Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485 # per bug #547485
ExecStart=@libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER ExecStart=@libexecdir@/mariadbd --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStartPost=@libexecdir@/mysql-check-upgrade ExecStartPost=@libexecdir@/mariadb-check-upgrade
# Setting this to true can break replication and the Type=notify settings # Setting this to true can break replication and the Type=notify settings
# See also bind-address mysqld option. # See also bind-address MariaDB option.
PrivateNetwork=false PrivateNetwork=false
KillMode=process KillMode=process

View File

@ -33,7 +33,7 @@
[Unit] [Unit]
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
Documentation=man:mysqld(8) Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/ Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target After=network.target
@ -47,16 +47,16 @@ Type=notify
User=mysql User=mysql
Group=mysql Group=mysql
ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I ExecStartPre=@libexecdir@/mariadb-check-socket --defaults-group-suffix=.%I
ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n ExecStartPre=@libexecdir@/mariadb-prepare-db-dir --defaults-group-suffix=.%I %n
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms, # Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485 # per bug #547485
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER ExecStart=@libexecdir@/mariadbd --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I ExecStartPost=@libexecdir@/mariadb-check-upgrade --defaults-group-suffix=.%I
# Setting this to true can break replication and the Type=notify settings # Setting this to true can break replication and the Type=notify settings
# See also bind-address mysqld option. # See also bind-address MariaDB option.
PrivateNetwork=false PrivateNetwork=false
KillMode=process KillMode=process