Commit 7803601d authored by Otto Kekäläinen's avatar Otto Kekäläinen Committed by Robert Bindar

MDEV-22569: Run bin/mariadbd instead of bin/mysqld

Replace all references to /usr/sbin/mysqld (and bin and libexec) with
mariadbd, so that the binary server will always be 'mariadbd'.

Also update all places that reference the server binary in other ways,
such as AppArmor profiles and scripts that previously expected to find
a 'mysqld' in process lists.
parent e290e5a7
...@@ -26,7 +26,7 @@ def add_info(report): ...@@ -26,7 +26,7 @@ def add_info(report):
report[key] = "" report[key] = ""
for line in read_file('/var/log/daemon.log').split('\n'): for line in read_file('/var/log/daemon.log').split('\n'):
try: try:
if 'mysqld' in line.split()[4]: if 'mariadbd' in line.split()[4]:
report[key] += line + '\n' report[key] += line + '\n'
except IndexError: except IndexError:
continue continue
...@@ -35,8 +35,8 @@ def add_info(report): ...@@ -35,8 +35,8 @@ def add_info(report):
report[key] = "" report[key] = ""
for line in read_file('/var/log/mysql/error.log').split('\n'): for line in read_file('/var/log/mysql/error.log').split('\n'):
report[key] += line + '\n' report[key] += line + '\n'
attach_mac_events(report, '/usr/sbin/mysqld') attach_mac_events(report, '/usr/sbin/mariadbd')
attach_file(report,'/etc/apparmor.d/usr.sbin.mysqld') attach_file(report,'/etc/apparmor.d/usr.sbin.mariadbd')
_add_my_conf_files(report, '/etc/mysql/mariadb.cnf') _add_my_conf_files(report, '/etc/mysql/mariadb.cnf')
for f in os.listdir('/etc/mysql/conf.d'): for f in os.listdir('/etc/mysql/conf.d'):
_add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f)) _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f))
......
...@@ -4,7 +4,7 @@ debian/additions/echo_stderr usr/share/mysql ...@@ -4,7 +4,7 @@ debian/additions/echo_stderr usr/share/mysql
debian/additions/mariadb.conf.d/50-mysqld_safe.cnf etc/mysql/mariadb.conf.d debian/additions/mariadb.conf.d/50-mysqld_safe.cnf etc/mysql/mariadb.conf.d
debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d
debian/additions/source_mariadb-10.5.py usr/share/apport/package-hooks debian/additions/source_mariadb-10.5.py usr/share/apport/package-hooks
etc/apparmor.d/usr.sbin.mysqld etc/apparmor.d/usr.sbin.mariadbd
etc/security/user_map.conf etc/security/user_map.conf
lib/*/security/pam_user_map.so lib/*/security/pam_user_map.so
lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf
...@@ -61,7 +61,7 @@ usr/lib/mysql/plugin/server_audit.so ...@@ -61,7 +61,7 @@ usr/lib/mysql/plugin/server_audit.so
usr/lib/mysql/plugin/simple_password_check.so usr/lib/mysql/plugin/simple_password_check.so
usr/lib/mysql/plugin/sql_errlog.so usr/lib/mysql/plugin/sql_errlog.so
usr/lib/mysql/plugin/wsrep_info.so usr/lib/mysql/plugin/wsrep_info.so
usr/share/doc/mariadb-server-10.5/mysqld.sym.gz usr/share/doc/mariadb-server-10.5/mariadbd.sym.gz
usr/share/man/man1/aria_chk.1 usr/share/man/man1/aria_chk.1
usr/share/man/man1/aria_dump_log.1 usr/share/man/man1/aria_dump_log.1
usr/share/man/man1/aria_ftdump.1 usr/share/man/man1/aria_ftdump.1
......
/etc/init.d/mariadb\[[0-9]+\]: Check that mysqld is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$
/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ /etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
mysqld\[[0-9]+\]: $ mariadbd\[[0-9]+\]: $
mysqld\[[0-9]+\]: Version: .* socket: '/run/mysqld/mysqld.sock' port: 3306$ mariadbd\[[0-9]+\]: Version: .* socket: '/run/mysqld/mysqld.sock' port: 3306$
mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ mariadbd\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
mysqld_safe\[[0-9]+\]: started$ mysqld_safe\[[0-9]+\]: started$
usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$ usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$ usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
/etc/init.d/mariadb\[[0-9]+\]: Check that mysqld is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$
/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ /etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
mysqld\[[0-9]+\]: ?$ mariadbd\[[0-9]+\]: ?$
mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed mariadbd\[[0-9]+\]: .*InnoDB: Shutdown completed
mysqld\[[0-9]+\]: .*InnoDB: Started; mariadbd\[[0-9]+\]: .*InnoDB: Started;
mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$ mariadbd\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: Normal shutdown$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: ready for connections\.$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: Shutdown complete$
mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$ mariadbd\[[0-9]+\]: /usr/sbin/mariadbd: ready for connections\.$
mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$ mariadbd\[[0-9]+\]: .*/usr/sbin/mariadbd: Shutdown Complete$
mysqld\[[0-9]+\]: Version: .* socket mariadbd\[[0-9]+\]: Version: .* socket
mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ mariadbd\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
mysqld_safe\[[0-9]+\]: ?$ mysqld_safe\[[0-9]+\]: ?$
mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$ mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
mysqld_safe\[[0-9]+\]: ended$ mysqld_safe\[[0-9]+\]: ended$
......
/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
/etc/init.d/mariadb\[[0-9]+\]: Check that mysqld is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$
/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ /etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
mysqld\[[0-9]+\]: ?$ mariadbd\[[0-9]+\]: ?$
mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed mariadbd\[[0-9]+\]: .*InnoDB: Shutdown completed
mysqld\[[0-9]+\]: .*InnoDB: Started; mariadbd\[[0-9]+\]: .*InnoDB: Started;
mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$ mariadbd\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: Normal shutdown$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: ready for connections\.$
mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$ mariadbd\[[0-9]+\]: .*\[Note\] /usr/sbin/mariadbd: Shutdown complete$
mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$ mariadbd\[[0-9]+\]: /usr/sbin/mariadbd: ready for connections\.$
mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$ mariadbd\[[0-9]+\]: .*/usr/sbin/mariadbd: Shutdown Complete$
mysqld\[[0-9]+\]: Version: .* socket mariadbd\[[0-9]+\]: Version: .* socket
mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ mariadbd\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
mysqld_safe\[[0-9]+\]: ?$ mysqld_safe\[[0-9]+\]: ?$
mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$ mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
mysqld_safe\[[0-9]+\]: ended$ mysqld_safe\[[0-9]+\]: ended$
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: Start and stop the mysql database server daemon # Short-Description: Start and stop the mysql database server daemon
# Description: Controls the main MariaDB database server daemon "mysqld" # Description: Controls the main MariaDB database server daemon "mariadbd"
# and its wrapper script "mysqld_safe". # and its wrapper script "mysqld_safe".
### END INIT INFO ### END INIT INFO
# #
...@@ -17,7 +17,7 @@ set -e ...@@ -17,7 +17,7 @@ set -e
set -u set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x} ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
test -x /usr/sbin/mysqld || exit 0 test -x /usr/sbin/mariadbd || exit 0
. /lib/lsb/init-functions . /lib/lsb/init-functions
...@@ -50,16 +50,16 @@ export HOME=/etc/mysql/ ...@@ -50,16 +50,16 @@ export HOME=/etc/mysql/
## Fetch a particular option from mysql's invocation. ## Fetch a particular option from mysql's invocation.
# #
# Usage: void mysqld_get_param option # Usage: void mariadbd_get_param option
mysqld_get_param() { mariadbd_get_param() {
/usr/sbin/mysqld --print-defaults \ /usr/sbin/mariadbd --print-defaults \
| tr " " "\n" \ | tr " " "\n" \
| grep -- "--$1" \ | grep -- "--$1" \
| tail -n 1 \ | tail -n 1 \
| cut -d= -f2 | cut -d= -f2
} }
## Do some sanity checks before even trying to start mysqld. ## Do some sanity checks before even trying to start mariadbd.
sanity_checks() { sanity_checks() {
# check for config file # check for config file
if [ ! -r /etc/mysql/my.cnf ]; then if [ ! -r /etc/mysql/my.cnf ]; then
...@@ -68,7 +68,7 @@ sanity_checks() { ...@@ -68,7 +68,7 @@ sanity_checks() {
fi fi
# check for diskspace shortage # check for diskspace shortage
datadir=`mysqld_get_param datadir` datadir=`mariadbd_get_param datadir`
if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
log_failure_msg "$0: ERROR: The partition with $datadir is too full!" log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
...@@ -79,14 +79,14 @@ sanity_checks() { ...@@ -79,14 +79,14 @@ sanity_checks() {
## Checks if there is a server running and if so if it is accessible. ## Checks if there is a server running and if so if it is accessible.
# #
# check_alive insists on a pingable server # check_alive insists on a pingable server
# check_dead also fails if there is a lost mysqld in the process list # check_dead also fails if there is a lost mariadbd in the process list
# #
# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn] # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn]
mysqld_status () { mariadbd_status () {
ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
ps_alive=0 ps_alive=0
pidfile=`mysqld_get_param pid-file` pidfile=`mariadbd_get_param pid-file`
if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
if [ "$1" = "check_alive" -a $ping_alive = 1 ] || if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
...@@ -109,8 +109,8 @@ case "${1:-''}" in ...@@ -109,8 +109,8 @@ case "${1:-''}" in
'start') 'start')
sanity_checks; sanity_checks;
# Start daemon # Start daemon
log_daemon_msg "Starting MariaDB database server" "mysqld" log_daemon_msg "Starting MariaDB database server" "mariadbd"
if mysqld_status check_alive nowarn; then if mariadbd_status check_alive nowarn; then
log_progress_msg "already running" log_progress_msg "already running"
log_end_msg 0 log_end_msg 0
else else
...@@ -122,10 +122,10 @@ case "${1:-''}" in ...@@ -122,10 +122,10 @@ case "${1:-''}" in
for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
sleep 1 sleep 1
if mysqld_status check_alive nowarn ; then break; fi if mariadbd_status check_alive nowarn ; then break; fi
log_progress_msg "." log_progress_msg "."
done done
if mysqld_status check_alive warn; then if mariadbd_status check_alive warn; then
log_end_msg 0 log_end_msg 0
# Now start mysqlcheck or whatever the admin wants. # Now start mysqlcheck or whatever the admin wants.
output=$(/etc/mysql/debian-start) output=$(/etc/mysql/debian-start)
...@@ -144,26 +144,26 @@ case "${1:-''}" in ...@@ -144,26 +144,26 @@ case "${1:-''}" in
# at least for cron, we can rely on it here, too. (although we have # at least for cron, we can rely on it here, too. (although we have
# to specify it explicit as e.g. sudo environments points to the normal # to specify it explicit as e.g. sudo environments points to the normal
# users home and not /root) # users home and not /root)
log_daemon_msg "Stopping MariaDB database server" "mysqld" log_daemon_msg "Stopping MariaDB database server" "mariadbd"
if ! mysqld_status check_dead nowarn; then if ! mariadbd_status check_dead nowarn; then
set +e set +e
shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
set -e set -e
if [ "$r" -ne 0 ]; then if [ "$r" -ne 0 ]; then
log_end_msg 1 log_end_msg 1
[ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
log_daemon_msg "Killing MariaDB database server by signal" "mysqld" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd"
killall -15 mysqld killall -15 mariadbd
server_down= server_down=
for i in `seq 1 600`; do for i in `seq 1 600`; do
sleep 1 sleep 1
if mysqld_status check_dead nowarn; then server_down=1; break; fi if mariadbd_status check_dead nowarn; then server_down=1; break; fi
done done
if test -z "$server_down"; then killall -9 mysqld; fi if test -z "$server_down"; then killall -9 mariadbd; fi
fi fi
fi fi
if ! mysqld_status check_dead warn; then if ! mariadbd_status check_dead warn; then
log_end_msg 1 log_end_msg 1
log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!"
exit -1 exit -1
...@@ -179,13 +179,13 @@ case "${1:-''}" in ...@@ -179,13 +179,13 @@ case "${1:-''}" in
;; ;;
'reload'|'force-reload') 'reload'|'force-reload')
log_daemon_msg "Reloading MariaDB database server" "mysqld" log_daemon_msg "Reloading MariaDB database server" "mariadbd"
$MYADMIN reload $MYADMIN reload
log_end_msg 0 log_end_msg 0
;; ;;
'status') 'status')
if mysqld_status check_alive nowarn; then if mariadbd_status check_alive nowarn; then
log_action_msg "$($MYADMIN version)" log_action_msg "$($MYADMIN version)"
else else
log_action_msg "MariaDB is stopped." log_action_msg "MariaDB is stopped."
...@@ -196,7 +196,7 @@ case "${1:-''}" in ...@@ -196,7 +196,7 @@ case "${1:-''}" in
'bootstrap') 'bootstrap')
# Bootstrap the cluster, start the first node # Bootstrap the cluster, start the first node
# that initiates the cluster # that initiates the cluster
log_daemon_msg "Bootstrapping the cluster" "mysqld" log_daemon_msg "Bootstrapping the cluster" "mariadbd"
$SELF start "${@:2}" --wsrep-new-cluster $SELF start "${@:2}" --wsrep-new-cluster
;; ;;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
sharedscripts sharedscripts
postrotate postrotate
test -x /usr/bin/mysqladmin || exit 0 test -x /usr/bin/mysqladmin || exit 0
if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then if [ -f `my_print_defaults --mariadbd | grep -oP "pid-file=\K[^$]+"` ]; then
# If this fails, check debian.conf! # If this fails, check debian.conf!
mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log \ mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log \
flush-engine-log flush-general-log flush-slow-log flush-engine-log flush-general-log flush-slow-log
......
...@@ -189,12 +189,12 @@ EOF ...@@ -189,12 +189,12 @@ EOF
# This allows upgrade from old versions (that have an apparmor profile # This allows upgrade from old versions (that have an apparmor profile
# on by default) to work both to disable a default profile, and to keep # on by default) to work both to disable a default profile, and to keep
# any profile installed and maintained by users themselves. # any profile installed and maintained by users themselves.
profile="/etc/apparmor.d/usr.sbin.mysqld" profile="/etc/apparmor.d/usr.sbin.mariadbd"
if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then
if grep -q /usr/sbin/mysqld "$profile" 2>/dev/null ; then if grep -q /usr/sbin/mariadbd "$profile" 2>/dev/null ; then
apparmor_parser -r "$profile" || true apparmor_parser -r "$profile" || true
else else
echo "/usr/sbin/mysqld { }" | apparmor_parser --remove 2>/dev/null || true echo "/usr/sbin/mariadbd { }" | apparmor_parser --remove 2>/dev/null || true
fi fi
fi fi
......
...@@ -13,11 +13,11 @@ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" ...@@ -13,11 +13,11 @@ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
# Try to stop the server in a sane way. If it does not success let the admin # Try to stop the server in a sane way. If it does not success let the admin
# do it himself. No database directories should be removed while the server # do it himself. No database directories should be removed while the server
# is running! Another mysqld in e.g. a different chroot is fine for us. # is running! Another mariadbd in e.g. a different chroot is fine for us.
stop_server() { stop_server() {
# Return immediately if there are no mysql processes running # Return immediately if there are no mysql processes running
# as there is no point in trying to shutdown in that case. # as there is no point in trying to shutdown in that case.
if ! pgrep -x mysqld > /dev/null; then return; fi if ! pgrep -x mariadbd > /dev/null; then return; fi
set +e set +e
invoke-rc.d mariadb stop invoke-rc.d mariadb stop
......
...@@ -26,11 +26,11 @@ mysql_upgradedir=/var/lib/mysql-upgrade ...@@ -26,11 +26,11 @@ mysql_upgradedir=/var/lib/mysql-upgrade
# Try to stop the server in a sane way. If it does not success let the admin # Try to stop the server in a sane way. If it does not success let the admin
# do it himself. No database directories should be removed while the server # do it himself. No database directories should be removed while the server
# is running! Another mysqld in e.g. a different chroot is fine for us. # is running! Another mariadbd in e.g. a different chroot is fine for us.
stop_server() { stop_server() {
# Return immediately if there are no mysql processes running # Return immediately if there are no mysql processes running
# as there is no point in trying to shutdown in that case. # as there is no point in trying to shutdown in that case.
if ! pgrep -x --ns $$ mysqld > /dev/null; then return; fi if ! pgrep -x --ns $$ mariadbd > /dev/null; then return; fi
set +e set +e
invoke-rc.d mariadb stop invoke-rc.d mariadb stop
......
...@@ -43,7 +43,7 @@ ifeq (32,$(DEB_HOST_ARCH_BITS)) ...@@ -43,7 +43,7 @@ ifeq (32,$(DEB_HOST_ARCH_BITS))
CMAKEFLAGS += -DWITHOUT_ROCKSDB=true CMAKEFLAGS += -DWITHOUT_ROCKSDB=true
endif endif
# Add extra flag to avoid WolfSSL code crashing the entire mysqld on s390x. This # Add extra flag to avoid WolfSSL code crashing the entire mariadbd on s390x. This
# can be removed once upstream has made the code s390x compatible, see # can be removed once upstream has made the code s390x compatible, see
# https://jira.mariadb.org/browse/MDEV-21705 and # https://jira.mariadb.org/browse/MDEV-21705 and
# https://github.com/wolfSSL/wolfssl/issues/2828 # https://github.com/wolfSSL/wolfssl/issues/2828
...@@ -136,10 +136,10 @@ endif ...@@ -136,10 +136,10 @@ endif
# nm numeric soft is not enough, therefore extra sort in command # nm numeric soft is not enough, therefore extra sort in command
# to satisfy Debian reproducible build requirements # to satisfy Debian reproducible build requirements
nm --defined-only $(BUILDDIR)/sql/mysqld | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.5/mysqld.sym.gz nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.5/mariadbd.sym.gz
# rename and install AppArmor profile # rename and install AppArmor profile
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mariadbd
# Install libmariadbclient18 compatibility links # Install libmariadbclient18 compatibility links
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so
......
...@@ -761,8 +761,8 @@ sub command_line_setup () { ...@@ -761,8 +761,8 @@ sub command_line_setup () {
"$path_client_bindir/mysqld-debug", "$path_client_bindir/mysqld-debug",
"$path_client_bindir/mysqld-max", "$path_client_bindir/mysqld-max",
"$glob_bindir/libexec/mysqld", "$glob_bindir/libexec/mysqld",
"$glob_bindir/bin/mysqld", "$glob_bindir/bin/mariadbd",
"$glob_bindir/sbin/mysqld"); "$glob_bindir/sbin/mariadbd");
# Use the mysqld found above to find out what features are available # Use the mysqld found above to find out what features are available
collect_mysqld_features(); collect_mysqld_features();
...@@ -4322,4 +4322,3 @@ sub list_options ($) { ...@@ -4322,4 +4322,3 @@ sub list_options ($) {
mtr_exit(1); mtr_exit(1);
} }
...@@ -518,25 +518,25 @@ then ...@@ -518,25 +518,25 @@ then
# BASEDIR is already overridden on command line. Do not re-set. # BASEDIR is already overridden on command line. Do not re-set.
# Use BASEDIR to discover le. # Use BASEDIR to discover le.
if test -x "$MY_BASEDIR_VERSION/libexec/mysqld" if test -x "$MY_BASEDIR_VERSION/libexec/mariadbd"
then then
ledir="$MY_BASEDIR_VERSION/libexec" ledir="$MY_BASEDIR_VERSION/libexec"
elif test -x "$MY_BASEDIR_VERSION/sbin/mysqld" elif test -x "$MY_BASEDIR_VERSION/sbin/mariadbd"
then then
ledir="$MY_BASEDIR_VERSION/sbin" ledir="$MY_BASEDIR_VERSION/sbin"
else else
ledir="$MY_BASEDIR_VERSION/bin" ledir="$MY_BASEDIR_VERSION/bin"
fi fi
elif test -x "$MY_PWD/bin/mysqld" elif test -x "$MY_PWD/bin/mariadbd"
then then
MY_BASEDIR_VERSION="$MY_PWD" # Where bin, share and data are MY_BASEDIR_VERSION="$MY_PWD" # Where bin, share and data are
ledir="$MY_PWD/bin" # Where mysqld is ledir="$MY_PWD/bin" # Where mysqld is
# Check for the directories we would expect from a source install # Check for the directories we would expect from a source install
elif test -x "$MY_PWD/libexec/mysqld" elif test -x "$MY_PWD/libexec/mariadbd"
then then
MY_BASEDIR_VERSION="$MY_PWD" # Where libexec, share and var are MY_BASEDIR_VERSION="$MY_PWD" # Where libexec, share and var are
ledir="$MY_PWD/libexec" # Where mysqld is ledir="$MY_PWD/libexec" # Where mysqld is
elif test -x "$MY_PWD/sbin/mysqld" elif test -x "$MY_PWD/sbin/mariadbd"
then then
MY_BASEDIR_VERSION="$MY_PWD" # Where sbin, share and var are MY_BASEDIR_VERSION="$MY_PWD" # Where sbin, share and var are
ledir="$MY_PWD/sbin" # Where mysqld is ledir="$MY_PWD/sbin" # Where mysqld is
...@@ -741,10 +741,10 @@ then ...@@ -741,10 +741,10 @@ then
chmod 755 $mysql_unix_port_dir chmod 755 $mysql_unix_port_dir
fi fi
# If the user doesn't specify a binary, we assume name "mysqld" # If the user doesn't specify a binary, we assume name "mariadbd"
if test -z "$MYSQLD" if test -z "$MYSQLD"
then then
MYSQLD=mysqld MYSQLD=mariadbd
fi fi
if test ! -x "$ledir/$MYSQLD" if test ! -x "$ledir/$MYSQLD"
......
...@@ -73,7 +73,7 @@ Note ...@@ -73,7 +73,7 @@ Note
/usr/local/mysql-5.1.39-osx10.5-x86_64 . The installation layout /usr/local/mysql-5.1.39-osx10.5-x86_64 . The installation layout
of the directory is as shown in the following table: of the directory is as shown in the following table:
Directory Contents of Directory Directory Contents of Directory
bin Client programs and the mysqld server bin Client programs and the mariadbd server
data Log files, databases data Log files, databases
docs Manual in Info format docs Manual in Info format
include Include (header) files include Include (header) files
...@@ -285,7 +285,7 @@ Note ...@@ -285,7 +285,7 @@ Note
Directory Contents of Directory Directory Contents of Directory
/usr/bin Client programs /usr/bin Client programs
/var/mysql Log files, databases /var/mysql Log files, databases
/usr/libexec The mysqld server /usr/libexec The mariadbd server
/usr/share/man Unix manual pages /usr/share/man Unix manual pages
/usr/share/mysql/mysql-test MySQL test suite /usr/share/mysql/mysql-test MySQL test suite
/usr/share/mysql Contains the mysql_install_db script /usr/share/mysql Contains the mysql_install_db script
......
...@@ -41,7 +41,7 @@ echo "" ...@@ -41,7 +41,7 @@ echo ""
./scripts/mysql_install_db --no-defaults ./scripts/mysql_install_db --no-defaults
if [ $? = 0 ] if [ $? = 0 ]
then then
echo "Starting the mysqld server. You can test that it is up and running" echo "Starting the mariadbd server. You can test that it is up and running"
echo "with the command:" echo "with the command:"
echo "./bin/mysqladmin version" echo "./bin/mysqladmin version"
./bin/mysqld_safe --no-defaults & ./bin/mysqld_safe --no-defaults &
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
[Unit] [Unit]
Description=MariaDB @VERSION@ database server Description=MariaDB @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
...@@ -37,7 +37,7 @@ WantedBy=multi-user.target ...@@ -37,7 +37,7 @@ WantedBy=multi-user.target
Type=notify Type=notify
# 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 mariadbd option.
PrivateNetwork=false PrivateNetwork=false
############################################################################## ##############################################################################
...@@ -89,7 +89,7 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ ...@@ -89,7 +89,7 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
# Use the [Service] section and Environment="MYSQLD_OPTS=...". # Use the [Service] section and Environment="MYSQLD_OPTS=...".
# This isn't a replacement for my.cnf. # This isn't a replacement for my.cnf.
# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster
ExecStart=@sbindir@/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION ExecStart=@sbindir@/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
# Unset _WSREP_START_POSITION environment variable. # Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
...@@ -118,7 +118,7 @@ UMask=007 ...@@ -118,7 +118,7 @@ UMask=007
# Useful options not previously available in [mysqld_safe] # Useful options not previously available in [mysqld_safe]
# Kernels like killing mysqld when out of memory because its big. # Kernels like killing mariadbd when out of memory because its big.
# Lets temper that preference a little. # Lets temper that preference a little.
# OOMScoreAdjust=-600 # OOMScoreAdjust=-600
...@@ -163,7 +163,7 @@ LimitNOFILE=16364 ...@@ -163,7 +163,7 @@ LimitNOFILE=16364
# ExecStartPre=sysctl -q -w vm.drop_caches=3 # ExecStartPre=sysctl -q -w vm.drop_caches=3
# numa-interleave=1 equalivant # numa-interleave=1 equalivant
# Change ExecStart=numactl --interleave=all @sbindir@/mysqld...... # Change ExecStart=numactl --interleave=all @sbindir@/mariadbd......
# crash-script equalivent # crash-script equalivent
# FailureAction= # FailureAction=
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
# like network ports, sockets and data directories listed under CONFLICTING # like network ports, sockets and data directories listed under CONFLICTING
# VARIABLES below. The systemd environment variable MYSQLD_MULTI_INSTANCE # VARIABLES below. The systemd environment variable MYSQLD_MULTI_INSTANCE
# controls each instance to ensure it is run independently. It is passed to # controls each instance to ensure it is run independently. It is passed to
# mysqld and mysql_install # mariadbd and mysql_install
# #
# By default, a group suffix exists and within the default configuration # By default, a group suffix exists and within the default configuration
# files, a group [mysqld.{instancename}] is read for each service. Other # files, a group [mariadbd.{instancename}] is read for each service. Other
# default groups, like [server.{instancename}] and [mariadb.{instancename}], # default groups, like [server.{instancename}] and [mariadb.{instancename}],
# are also read. For each instance, one of the groups will need to contain # are also read. For each instance, one of the groups will need to contain
# the conflicting variables listed below under CONFLICTING VARIABLES. # the conflicting variables listed below under CONFLICTING VARIABLES.
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
# Before 10.4 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=@sysconf2dir@/my%I.cnf # Before 10.4 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=@sysconf2dir@/my%I.cnf
# As @sysconfdir@/my.cnf included these files it was a bad choice as an # As @sysconfdir@/my.cnf included these files it was a bad choice as an
# existing single instance would include all these files. If you want to # existing single instance would include all these files. If you want to
# continue a file based multi-instance mysqld, recommend the Configuration File # continue a file based multi-instance mariadbd, recommend the Configuration File
# Based Mechanism above and moving @sysconf2dir@/my%I.cnf files to @sysconfdir@/my%I.cnf. # Based Mechanism above and moving @sysconf2dir@/my%I.cnf files to @sysconfdir@/my%I.cnf.
# #
# #
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
[Unit] [Unit]
Description=MariaDB @VERSION@ database server (multi-instance %I) Description=MariaDB @VERSION@ database server (multi-instance %I)
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
...@@ -170,7 +170,7 @@ WantedBy=multi-user.target ...@@ -170,7 +170,7 @@ WantedBy=multi-user.target
Type=notify Type=notify
# 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 mariadbd option.
PrivateNetwork=false PrivateNetwork=false
############################################################################## ##############################################################################
...@@ -206,7 +206,7 @@ ExecStartPre=@scriptdir@/mysql_install_db $MYSQLD_MULTI_INSTANCE ...@@ -206,7 +206,7 @@ ExecStartPre=@scriptdir@/mysql_install_db $MYSQLD_MULTI_INSTANCE
# * MYSQLD_OPTS - user definable extras - not a replacement for my.cnf # * MYSQLD_OPTS - user definable extras - not a replacement for my.cnf
# #
# Note 1: Place $MYSQLD_OPTS at the very end for its options to take precedence. # Note 1: Place $MYSQLD_OPTS at the very end for its options to take precedence.
ExecStart=@sbindir@/mysqld $MYSQLD_MULTI_INSTANCE $MYSQLD_OPTS ExecStart=@sbindir@/mariadbd $MYSQLD_MULTI_INSTANCE $MYSQLD_OPTS
@SYSTEMD_EXECSTARTPOST@ @SYSTEMD_EXECSTARTPOST@
...@@ -232,7 +232,7 @@ UMask=007 ...@@ -232,7 +232,7 @@ UMask=007
# Useful options not previously available in [mysqld_safe] # Useful options not previously available in [mysqld_safe]
# Kernels like killing mysqld when out of memory because its big. # Kernels like killing mariadbd when out of memory because its big.
# Lets temper that preference a little. # Lets temper that preference a little.
# OOMScoreAdjust=-600 # OOMScoreAdjust=-600
...@@ -288,7 +288,7 @@ LimitNOFILE=16364 ...@@ -288,7 +288,7 @@ LimitNOFILE=16364
# ExecStartPre=sysctl -q -w vm.drop_caches=3 # ExecStartPre=sysctl -q -w vm.drop_caches=3
# numa-interleave=1 equalivant # numa-interleave=1 equalivant
# Change ExecStart=numactl --interleave=all @sbindir@/mysqld...... # Change ExecStart=numactl --interleave=all @sbindir@/mariadbd......
# crash-script equalivent # crash-script equalivent
# FailureAction= # FailureAction=
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
missingok missingok
compress compress
postrotate postrotate
# just if mysqld is really running # just if mariadbd is really running
if test -x @bindir@/mysqladmin && \ if test -x @bindir@/mysqladmin && \
@bindir@/mysqladmin ping &>/dev/null @bindir@/mysqladmin ping &>/dev/null
then then
......
...@@ -50,7 +50,7 @@ then ...@@ -50,7 +50,7 @@ then
exit 1 exit 1
fi fi
echo "mysqld $svr $mode" echo "mariadbd $svr $mode"
parse_arguments() { parse_arguments() {
for arg do for arg do
...@@ -107,7 +107,7 @@ fi ...@@ -107,7 +107,7 @@ fi
datadir=@localstatedir@ datadir=@localstatedir@
basedir= basedir=
pid_file= pid_file=
parse_arguments `$print_defaults $defaults mysqld mysql_server mysql_multi_server` parse_arguments `$print_defaults $defaults mariadbd mysqld mysql_server mysql_multi_server`
if test -z "$basedir" if test -z "$basedir"
then then
...@@ -157,15 +157,15 @@ case "$mode" in ...@@ -157,15 +157,15 @@ case "$mode" in
# root password. # root password.
if test -f "$pid_file" if test -f "$pid_file"
then then
mysqld_pid=`cat $pid_file` mariadbd_pid=`cat $pid_file`
echo "Killing mysqld $svr with pid $mysqld_pid" echo "Killing mariadbd $svr with pid $mariadbd_pid"
kill $mysqld_pid kill $mariadbd_pid
# mysqld should remove the pid_file when it exits, so wait for it. # mariadbd should remove the pid_file when it exits, so wait for it.
sleep 1 sleep 1
while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ] while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
do do
[ -z "$flags" ] && echo "Wait for mysqld $svr to exit\c" || echo ".\c" [ -z "$flags" ] && echo "Wait for mariadbd $svr to exit\c" || echo ".\c"
flags=a$flags flags=a$flags
sleep 1 sleep 1
done done
...@@ -180,7 +180,7 @@ case "$mode" in ...@@ -180,7 +180,7 @@ case "$mode" in
rm /var/lock/subsys/mysql rm /var/lock/subsys/mysql
fi fi
else else
echo "No mysqld pid file found. Looked for $pid_file." echo "No mariadbd pid file found. Looked for $pid_file."
fi fi
;; ;;
......
...@@ -30,7 +30,7 @@ EOF ...@@ -30,7 +30,7 @@ EOF
do_start() { do_start() {
nohup ./bin/mysqld --defaults-file="$MY_CFG" & nohup ./bin/mariadbd --defaults-file="$MY_CFG" &
} }
do_stop() { do_stop() {
...@@ -45,7 +45,7 @@ do_kill_all() { ...@@ -45,7 +45,7 @@ do_kill_all() {
} }
do_kill() { do_kill() {
MY_PIDFILE=`read_mysql_config "$MY_CFG" "mysqld" "pidfile" ` MY_PIDFILE=`read_mysql_config "$MY_CFG" "mariadbd" "pidfile" `
read MY_PID < "$MY_PIDFILE" read MY_PID < "$MY_PIDFILE"
kill "$MY_PID" kill "$MY_PID"
sleep 2 sleep 2
...@@ -60,14 +60,14 @@ do_admin() { ...@@ -60,14 +60,14 @@ do_admin() {
} }
do_repair() { do_repair() {
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" ` MY_DATADIR=`read_mysql_config "$MY_CFG" "mariadbd" "datadir" `
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$1" ./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$1"
shift shift
} }
do_repair_all() { do_repair_all() {
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" ` MY_DATADIR=`read_mysql_config "$MY_CFG" "mariadbd" "datadir" `
for i in `find "$MY_DATADIR" -name "*.ISM"` for i in `find "$MY_DATADIR" -name "*.ISM"`
do do
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$i" ./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$i"
...@@ -76,7 +76,7 @@ do_repair_all() { ...@@ -76,7 +76,7 @@ do_repair_all() {
MY_BASEDIR=`read_mysql_config "$MY_CFG" "mysqld" "basedir"` MY_BASEDIR=`read_mysql_config "$MY_CFG" "mariadbd" "basedir"`
cd "$MY_BASEDIR" || exit 1 cd "$MY_BASEDIR" || exit 1
while test $# -gt 0 while test $# -gt 0
do do
......
...@@ -59,7 +59,7 @@ lock_file_path="$lockdir/mysql" ...@@ -59,7 +59,7 @@ lock_file_path="$lockdir/mysql"
# The following variables are only set for letting mysql.server find things. # The following variables are only set for letting mysql.server find things.
# Set some defaults # Set some defaults
mysqld_pid_file_path= mariadbd_pid_file_path=
if test -z "$basedir" if test -z "$basedir"
then then
basedir=@prefix@ basedir=@prefix@
...@@ -77,7 +77,7 @@ else ...@@ -77,7 +77,7 @@ else
datadir="$basedir/data" datadir="$basedir/data"
fi fi
sbindir="$basedir/sbin" sbindir="$basedir/sbin"
if test -f "$basedir/bin/mysqld" if test -f "$basedir/bin/mariadbd"
then then
libexecdir="$basedir/bin" libexecdir="$basedir/bin"
else else
...@@ -134,7 +134,7 @@ parse_server_arguments() { ...@@ -134,7 +134,7 @@ parse_server_arguments() {
datadir="$basedir/data" datadir="$basedir/data"
fi fi
sbindir="$basedir/sbin" sbindir="$basedir/sbin"
if test -f "$basedir/bin/mysqld" if test -f "$basedir/bin/mariadbd"
then then
libexecdir="$basedir/bin" libexecdir="$basedir/bin"
else else
...@@ -146,9 +146,9 @@ parse_server_arguments() { ...@@ -146,9 +146,9 @@ parse_server_arguments() {
datadir_set=1 datadir_set=1
;; ;;
--log-basename=*|--hostname=*|--loose-log-basename=*) --log-basename=*|--hostname=*|--loose-log-basename=*)
mysqld_pid_file_path="$val.pid" mariadbd_pid_file_path="$val.pid"
;; ;;
--pid-file=*) mysqld_pid_file_path="$val" ;; --pid-file=*) mariadbd_pid_file_path="$val" ;;
--service-startup-timeout=*) service_startup_timeout="$val" ;; --service-startup-timeout=*) service_startup_timeout="$val" ;;
--user=*) user="$val"; ;; --user=*) user="$val"; ;;
esac esac
...@@ -280,13 +280,13 @@ wait_for_ready () { ...@@ -280,13 +280,13 @@ wait_for_ready () {
# #
# Set pid file if not given # Set pid file if not given
# #
if test -z "$mysqld_pid_file_path" if test -z "$mariadbd_pid_file_path"
then then
mysqld_pid_file_path=$datadir/`@HOSTNAME@`.pid mariadbd_pid_file_path=$datadir/`@HOSTNAME@`.pid
else else
case "$mysqld_pid_file_path" in case "$mariadbd_pid_file_path" in
/* ) ;; /* ) ;;
* ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;; * ) mariadbd_pid_file_path="$datadir/$mariadbd_pid_file_path" ;;
esac esac
fi fi
...@@ -307,7 +307,7 @@ case "$mode" in ...@@ -307,7 +307,7 @@ case "$mode" in
then then
# Give extra arguments to mysqld with the my.cnf file. This script # Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade. # may be overwritten at next upgrade.
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" & $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mariadbd_pid_file_path" "$@" &
wait_for_ready; return_value=$? wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE # Make lock for RedHat / SuSE
...@@ -326,18 +326,18 @@ case "$mode" in ...@@ -326,18 +326,18 @@ case "$mode" in
# Stop daemon. We use a signal here to avoid having to know the # Stop daemon. We use a signal here to avoid having to know the
# root password. # root password.
if test -s "$mysqld_pid_file_path" if test -s "$mariadbd_pid_file_path"
then then
mysqld_pid=`cat "$mysqld_pid_file_path"` mariadbd_pid=`cat "$mariadbd_pid_file_path"`
if su_kill -0 $mysqld_pid ; then if su_kill -0 $mariadbd_pid ; then
echo $echo_n "Shutting down MariaDB" echo $echo_n "Shutting down MariaDB"
su_kill $mysqld_pid su_kill $mariadbd_pid
# mysqld should remove the pid file when it exits, so wait for it. # mysqld should remove the pid file when it exits, so wait for it.
wait_for_gone $mysqld_pid "$mysqld_pid_file_path"; return_value=$? wait_for_gone $mariadbd_pid "$mariadbd_pid_file_path"; return_value=$?
else else
log_failure_msg "MariaDB server process #$mysqld_pid is not running!" log_failure_msg "MariaDB server process #$mariadbd_pid is not running!"
rm "$mysqld_pid_file_path" rm "$mariadbd_pid_file_path"
fi fi
# Delete lock for RedHat / SuSE # Delete lock for RedHat / SuSE
...@@ -366,10 +366,10 @@ case "$mode" in ...@@ -366,10 +366,10 @@ case "$mode" in
;; ;;
'reload'|'force-reload') 'reload'|'force-reload')
if test -s "$mysqld_pid_file_path" ; then if test -s "$mariadbd_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path" read mariadbd_pid < "$mariadbd_pid_file_path"
su_kill -HUP $mysqld_pid && log_success_msg "Reloading service MariaDB" su_kill -HUP $mariadbd_pid && log_success_msg "Reloading service MariaDB"
touch "$mysqld_pid_file_path" touch "$mariadbd_pid_file_path"
else else
log_failure_msg "MariaDB PID file could not be found!" log_failure_msg "MariaDB PID file could not be found!"
exit 1 exit 1
...@@ -377,25 +377,25 @@ case "$mode" in ...@@ -377,25 +377,25 @@ case "$mode" in
;; ;;
'status') 'status')
# First, check to see if pid file exists # First, check to see if pid file exists
if test -s "$mysqld_pid_file_path" ; then if test -s "$mariadbd_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path" read mariadbd_pid < "$mariadbd_pid_file_path"
if su_kill -0 $mysqld_pid ; then if su_kill -0 $mariadbd_pid ; then
log_success_msg "MariaDB running ($mysqld_pid)" log_success_msg "MariaDB running ($mariadbd_pid)"
exit 0 exit 0
else else
log_failure_msg "MariaDB is not running, but PID file exists" log_failure_msg "MariaDB is not running, but PID file exists"
exit 1 exit 1
fi fi
else else
# Try to find appropriate mysqld process # Try to find appropriate mariadbd process
mysqld_pid=`pgrep -f $libexecdir/mysqld` mariadbd_pid=`pgrep -f $libexecdir/mariadbd`
# test if multiple pids exist # test if multiple pids exist
pid_count=`echo $mysqld_pid | wc -w` pid_count=`echo $mariadbd_pid | wc -w`
if test $pid_count -gt 1 ; then if test $pid_count -gt 1 ; then
log_failure_msg "Multiple MariaDB running but PID file could not be found ($mysqld_pid)" log_failure_msg "Multiple MariaDB running but PID file could not be found ($mariadbd_pid)"
exit 5 exit 5
elif test -z $mysqld_pid ; then elif test -z $mariadbd_pid ; then
if test -f "$lock_file_path" ; then if test -f "$lock_file_path" ; then
log_failure_msg "MariaDB is not running, but lock file ($lock_file_path) exists" log_failure_msg "MariaDB is not running, but lock file ($lock_file_path) exists"
exit 2 exit 2
...@@ -412,18 +412,18 @@ case "$mode" in ...@@ -412,18 +412,18 @@ case "$mode" in
# Safeguard (relative paths, core dumps..) # Safeguard (relative paths, core dumps..)
cd $basedir cd $basedir
echo $echo_n "Testing MariaDB configuration syntax" echo $echo_n "Testing MariaDB configuration syntax"
daemon=$bindir/mysqld daemon=$bindir/mariadbd
if test -x $libexecdir/mysqld if test -x $libexecdir/mariadbd
then then
daemon=$libexecdir/mysqld daemon=$libexecdir/mariadbd
elif test -x $sbindir/mysqld elif test -x $sbindir/mariadbd
then then
daemon=$sbindir/mysqld daemon=$sbindir/mariadbd
elif test -x `which mysqld` elif test -x `which mariadbd`
then then
daemon=`which mysqld` daemon=`which mariadbd`
else else
log_failure_msg "Unable to locate the mysqld binary!" log_failure_msg "Unable to locate the mariadbd binary!"
exit 1 exit 1
fi fi
help_out=`$daemon --help 2>&1`; r=$? help_out=`$daemon --help 2>&1`; r=$?
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <tunables/global> #include <tunables/global>
/usr/sbin/mysqld flags=(complain) { /usr/sbin/mariadbd flags=(complain) {
#include <abstractions/base> #include <abstractions/base>
#include <abstractions/mysql> #include <abstractions/mysql>
#include <abstractions/nameservice> #include <abstractions/nameservice>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
/tmp/** rw, /tmp/** rw,
/usr/lib/mysql/plugin/ r, /usr/lib/mysql/plugin/ r,
/usr/lib/mysql/plugin/*.so* mr, /usr/lib/mysql/plugin/*.so* mr,
/usr/sbin/mysqld mr, /usr/sbin/mariadbd mr,
/usr/share/mysql/** r, /usr/share/mysql/** r,
/var/lib/mysql/ r, /var/lib/mysql/ r,
/var/lib/mysql/** rwk, /var/lib/mysql/** rwk,
...@@ -147,5 +147,5 @@ ...@@ -147,5 +147,5 @@
/usr/bin/xbstream rix, /usr/bin/xbstream rix,
} }
# Site-specific additions and overrides. See local/README for details. # Site-specific additions and overrides. See local/README for details.
#include <local/usr.sbin.mysqld> #include <local/usr.sbin.mariadbd>
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment