summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql/mariadb/mysqld.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/mysqld.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/mysqld.service')
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/mysqld.service9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.service b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
index 757d0386c..d88361703 100644
--- a/meta-oe/recipes-support/mysql/mariadb/mysqld.service
+++ b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
@@ -8,7 +8,16 @@ PIDFile=/var/lib/mysql/mysqld.pid
8Type=simple 8Type=simple
9User=mysql 9User=mysql
10Group=mysql 10Group=mysql
11
12# Execute post scripts as root
13PermissionsStartOnly=true
14
15# Start main service
11ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@ 16ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@
17
18# Don't signal startup success before a ping works
19ExecStartPost=@BINDIR@/mysql-systemd-start post
20
12TimeoutSec=300 21TimeoutSec=300
13PrivateTmp=true 22PrivateTmp=true
14 23