* [PATCH] mariadb: make it be able to work with SELinux
@ 2015-02-06 5:59 rongqing.li
2015-02-06 8:41 ` Koen Kooi
0 siblings, 1 reply; 2+ messages in thread
From: rongqing.li @ 2015-02-06 5:59 UTC (permalink / raw)
To: openembedded-devel
From: Roy Li <rongqing.li@windriver.com>
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>
---
meta-oe/recipes-support/mysql/mariadb.inc | 1 +
meta-oe/recipes-support/mysql/mariadb/my.cnf | 2 +-
meta-oe/recipes-support/mysql/mariadb/mysqld.service | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta-oe/recipes-support/mysql/mariadb.inc b/meta-oe/recipes-support/mysql/mariadb.inc
index 8068862..f385bfc 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 876ce36..28d3899 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 18ad8d5..757d038 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
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mariadb: make it be able to work with SELinux
2015-02-06 5:59 [PATCH] mariadb: make it be able to work with SELinux rongqing.li
@ 2015-02-06 8:41 ` Koen Kooi
0 siblings, 0 replies; 2+ messages in thread
From: Koen Kooi @ 2015-02-06 8:41 UTC (permalink / raw)
To: openembedded-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
rongqing.li@windriver.com schreef op 06-02-15 om 06:59:
> From: Roy Li <rongqing.li@windriver.com>
>
> 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
Shouldn't those all use the ${localstatedir} variable instead of hardcoding?
>
> Signed-off-by: Roy Li <rongqing.li@windriver.com> ---
> meta-oe/recipes-support/mysql/mariadb.inc | 1 +
> meta-oe/recipes-support/mysql/mariadb/my.cnf | 2 +-
> meta-oe/recipes-support/mysql/mariadb/mysqld.service | 1 + 3 files
> changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meta-oe/recipes-support/mysql/mariadb.inc
> b/meta-oe/recipes-support/mysql/mariadb.inc index 8068862..f385bfc
> 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 876ce36..28d3899
> 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
> 18ad8d5..757d038 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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org
iD8DBQFU1H5NMkyGM64RGpERAiEDAJ9sJEaiGqhauXo0DJD2+cgMPshg8wCgsfHO
DBiU69t3NR66pAvdQyNlh/Y=
=KiCJ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-06 8:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 5:59 [PATCH] mariadb: make it be able to work with SELinux rongqing.li
2015-02-06 8:41 ` Koen Kooi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.