Skip to content

Commit

Permalink
rpm-install/upgrade: use control_mariadb_server_start
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Nov 27, 2024
1 parent dbbb89c commit 511c543
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
14 changes: 2 additions & 12 deletions scripts/rpm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,8 @@ sh -c 'g=/usr/lib*/galera*/libgalera_smm.so; echo -e "[galera]\nwsrep_provider=$
# Any of the below steps could fail
trap save_failure_logs ERR
set -e
case "$systemdCapability" in
yes)
if ! sudo systemctl start mariadb; then
sudo journalctl -lxn 500 --no-pager -u mariadb.service
sudo systemctl -l status mariadb.service --no-pager
exit 1
fi
;;
no)
sudo /etc/init.d/mysql restart
;;
esac

control_mariadb_server start

sudo mariadb -e "drop database if exists test; \
create database test; \
Expand Down
24 changes: 2 additions & 22 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,8 @@ echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" install ||
#fi

# Start the server, check that it is working and create some structures
case $(expr "$prev_major_version" '<' "10.1")"$systemdCapability" in
0yes)
sudo systemctl start mariadb
if [[ $distro != *"sles"* ]] && [[ $distro != *"suse"* ]]; then
sudo systemctl enable mariadb
else
bb_log_warn "due to MDEV-23044 mariadb service won't be enabled in the test"
fi
sudo systemctl status mariadb --no-pager
;;
*)
sudo /etc/init.d/mysql start
;;
esac

# shellcheck disable=SC2181
if (($? != 0)); then
bb_log_err "Server startup failed"
sudo cat /var/log/messages | grep -iE 'mysqld|mariadb'
sudo cat /var/lib/mysql/*.err
exit 1
fi
#
control_mariadb_server start

check_mariadb_server_and_create_structures

Expand Down

0 comments on commit 511c543

Please sign in to comment.