aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-02-06 13:59:46 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-02-12 19:35:39 +0100
commit9bb362cb3fdf3c28c6bb1f510fd303b5297c218f (patch)
tree9d8ea038e3e1bd517a7a747e3dee6964791e5101
parentf83d255736a43bbd2bdef702c5aa08936b8343c6 (diff)
downloadmeta-openembedded-contrib-9bb362cb3fdf3c28c6bb1f510fd303b5297c218f.tar.gz
meta-openembedded-contrib-9bb362cb3fdf3c28c6bb1f510fd303b5297c218f.tar.bz2
meta-openembedded-contrib-9bb362cb3fdf3c28c6bb1f510fd303b5297c218f.zip
mariadb: make it be able to work with SELinux
1. change the datadir from /var/mysql to /var/lib/mysql 2. after creating datedir, restorecon on it, make SELinux be able to work 3. Add the PIDFile for systemd unit file, otherwise systemctl can not stop mysqld Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/mysql/mariadb.inc1
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/my.cnf2
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/mysqld.service1
3 files changed, 3 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/mysql/mariadb.inc b/meta-oe/recipes-support/mysql/mariadb.inc
index 80688623fe..f385bfcda5 100644
--- a/meta-oe/recipes-support/mysql/mariadb.inc
+++ b/meta-oe/recipes-support/mysql/mariadb.inc
@@ -128,6 +128,7 @@ pkg_postinst_${PN}-server () {
mysql_install_db --basedir=${prefix} --user=mysql
+ [ -x /sbin/restorecon ] && /sbin/restorecon -RF /var/lib/mysql
}
PACKAGES = "${PN}-dbg ${PN} \
diff --git a/meta-oe/recipes-support/mysql/mariadb/my.cnf b/meta-oe/recipes-support/mysql/mariadb/my.cnf
index 876ce366a6..28d389922b 100644
--- a/meta-oe/recipes-support/mysql/mariadb/my.cnf
+++ b/meta-oe/recipes-support/mysql/mariadb/my.cnf
@@ -13,7 +13,7 @@ socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysqld.pid
log-error = /var/log/mysqld.err
basedir = /usr
-datadir = /var/mysql
+datadir = /var/lib/mysql
skip-external-locking
skip-networking
ignore-builtin-innodb
diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.service b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
index 18ad8d54d7..757d0386c3 100644
--- a/meta-oe/recipes-support/mysql/mariadb/mysqld.service
+++ b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
@@ -4,6 +4,7 @@ After=syslog.target
After=network.target
[Service]
+PIDFile=/var/lib/mysql/mysqld.pid
Type=simple
User=mysql
Group=mysql