diff options
author | Roy Li <rongqing.li@windriver.com> | 2015-02-06 13:59:46 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-02-12 19:35:39 +0100 |
commit | 9bb362cb3fdf3c28c6bb1f510fd303b5297c218f (patch) | |
tree | 9d8ea038e3e1bd517a7a747e3dee6964791e5101 /meta-oe/recipes-support/mysql | |
parent | f83d255736a43bbd2bdef702c5aa08936b8343c6 (diff) | |
download | meta-openembedded-9bb362cb3fdf3c28c6bb1f510fd303b5297c218f.tar.gz |
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>
Diffstat (limited to 'meta-oe/recipes-support/mysql')
-rw-r--r-- | meta-oe/recipes-support/mysql/mariadb.inc | 1 | ||||
-rw-r--r-- | meta-oe/recipes-support/mysql/mariadb/my.cnf | 2 | ||||
-rw-r--r-- | meta-oe/recipes-support/mysql/mariadb/mysqld.service | 1 |
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 80688623f..f385bfcda 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 () { | |||
128 | 128 | ||
129 | mysql_install_db --basedir=${prefix} --user=mysql | 129 | mysql_install_db --basedir=${prefix} --user=mysql |
130 | 130 | ||
131 | [ -x /sbin/restorecon ] && /sbin/restorecon -RF /var/lib/mysql | ||
131 | } | 132 | } |
132 | 133 | ||
133 | PACKAGES = "${PN}-dbg ${PN} \ | 134 | 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 876ce366a..28d389922 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 | |||
13 | pid-file = /var/lib/mysql/mysqld.pid | 13 | pid-file = /var/lib/mysql/mysqld.pid |
14 | log-error = /var/log/mysqld.err | 14 | log-error = /var/log/mysqld.err |
15 | basedir = /usr | 15 | basedir = /usr |
16 | datadir = /var/mysql | 16 | datadir = /var/lib/mysql |
17 | skip-external-locking | 17 | skip-external-locking |
18 | skip-networking | 18 | skip-networking |
19 | ignore-builtin-innodb | 19 | ignore-builtin-innodb |
diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.service b/meta-oe/recipes-support/mysql/mariadb/mysqld.service index 18ad8d54d..757d0386c 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 | |||
4 | After=network.target | 4 | After=network.target |
5 | 5 | ||
6 | [Service] | 6 | [Service] |
7 | PIDFile=/var/lib/mysql/mysqld.pid | ||
7 | Type=simple | 8 | Type=simple |
8 | User=mysql | 9 | User=mysql |
9 | Group=mysql | 10 | Group=mysql |