aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql/mariadb/install_db.service
AgeCommit message (Collapse)Author
2015-12-18mariadb.inc: fix mysqld hung at first init time based on systemdHongxu Jia
While SYSTEMD_AUTO_ENABLE_mariadb-server = "enable", the mysqld service hungs. ... [ **] A start job is running for Run pending postinsts (25s / no limit) [ OK ] Stopped MariaDB database server. ... In mariadb-server's pkg_postinst, it install db at first runtime. And the following 'systemctl mysqld restart' casued the hunging. So the fix idea is to reomove pkg_postinst and still install db at first runtime. Introduce mysql-systemd-start from ${S}/packaging/rpm-oel/. For review convenience, we add them as file. The mysql-systemd-start provides two functions: the install_db is to install db at fist runtime (the first runtime means if a db existed, the install_db will directly exit); the pinger is to wait for mysqld service startup completed. The mysqld.service add ExecStartPost than previous which invoke 'mysql-systemd-start post' to wait for mysqld service startup completed. We add a package to provide install_db, so the user could choose it to install database for mariadb at first boot before mysqld started. It also fix another issue: When you manually restart mysqld and do mysql test to connect the server, the return of the restart could make sure mysqld is ready, and the following db connect will not fail with: ... Can't connect to local MySQL server through socket ... Tweak my.cnf to remove obsolete/incorrect parameter. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>