aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql/mariadb/install_db.service
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2015-11-25 10:04:31 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-12-18 12:39:49 +0100
commitc0a1be1cebfc098d342f9efe147b193b51d5a8a2 (patch)
treeeece26973d343dee19cfc0fd924e143fdac9e18d /meta-oe/recipes-support/mysql/mariadb/install_db.service
parent0c923c7e33838f9132c9c62593bff42f5514a221 (diff)
downloadmeta-openembedded-c0a1be1cebfc098d342f9efe147b193b51d5a8a2.tar.gz
mariadb.inc: fix mysqld hung at first init time based on systemd
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>
Diffstat (limited to 'meta-oe/recipes-support/mysql/mariadb/install_db.service')
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/install_db.service17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mysql/mariadb/install_db.service b/meta-oe/recipes-support/mysql/mariadb/install_db.service
new file mode 100644
index 0000000000..c8369f569b
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/install_db.service
@@ -0,0 +1,17 @@
+#
+# Simple install MySQL database service file
+# It shoulb be done before mysqld.service
+
+[Unit]
+Description=Install MySQL Community Server Database
+After=network.target
+After=syslog.target
+Before=mysqld.service
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=@BINDIR@/mysql-systemd-start pre
+