mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-07 05:10:20 +00:00
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>
This commit is contained in:
@@ -128,6 +128,7 @@ pkg_postinst_${PN}-server () {
|
|||||||
|
|
||||||
mysql_install_db --basedir=${prefix} --user=mysql
|
mysql_install_db --basedir=${prefix} --user=mysql
|
||||||
|
|
||||||
|
[ -x /sbin/restorecon ] && /sbin/restorecon -RF /var/lib/mysql
|
||||||
}
|
}
|
||||||
|
|
||||||
PACKAGES = "${PN}-dbg ${PN} \
|
PACKAGES = "${PN}-dbg ${PN} \
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ socket = /var/lib/mysql/mysql.sock
|
|||||||
pid-file = /var/lib/mysql/mysqld.pid
|
pid-file = /var/lib/mysql/mysqld.pid
|
||||||
log-error = /var/log/mysqld.err
|
log-error = /var/log/mysqld.err
|
||||||
basedir = /usr
|
basedir = /usr
|
||||||
datadir = /var/mysql
|
datadir = /var/lib/mysql
|
||||||
skip-external-locking
|
skip-external-locking
|
||||||
skip-networking
|
skip-networking
|
||||||
ignore-builtin-innodb
|
ignore-builtin-innodb
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ After=syslog.target
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
PIDFile=/var/lib/mysql/mysqld.pid
|
||||||
Type=simple
|
Type=simple
|
||||||
User=mysql
|
User=mysql
|
||||||
Group=mysql
|
Group=mysql
|
||||||
|
|||||||
Reference in New Issue
Block a user