Symptoms
The cPanel & WHM software reports MySQL is down while mysqld_safe is running.
# /usr/local/cpanel/scripts/restartsrv_mysql --status
(XID l35tte) The “mysql” service is down
# ps fauxww | grep mysq[l]
root 1030 0.0 0.1 113632 1592 ? S 12:21 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/host.hostname.tld.pid
mysql 1134 0.0 8.7 1305384 88428 ? Sl 12:21 0:01 \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/host.hostname.tld.err --open-files-limit=10000 --pid-file=/var/lib/mysql/$hostname.pid
Description
MariaDB versions between 10.1.17 and 10.4.4 on EL7/8 systems are subject to a race condition between systemd and the init script they provide. This means that upon reboot, sometimes mysqld gets restarted with mysqld_safe when it never should.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Make sure that MariaDB is enabled with this command:
systemctl enable mariadb
- Stop MariaDB.
/usr/local/cpanel/scripts/restartsrv_mysql --stop
- Start MariaDB.
/usr/local/cpanel/scripts/restartsrv_mysql --start
Comments
0 comments
Article is closed for comments.