Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-24 Thread Bernard Fay
James, I read your email a couple of times. There is so much to learn from it. If I am right, the output of "semanage fcontext -l" is the content of the SELinux database regarding the SELinux contexts. Yet if I am right, when we try to assign or verify what should be the contexts on files or di

Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread James Hogarth
On 23 October 2017 at 19:18, Bernard Fay wrote: > Thanks, I managed to fix /var/lib/mysql > > # ls -ldZ /var/lib/mysql > drwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 /var/lib/mysql > > To fix it, I tried: > semanage fcontext -d -e /var/lib/mysql > this command returned: > KeyError: /va

Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread Bernard Fay
Thanks, I managed to fix /var/lib/mysql # ls -ldZ /var/lib/mysql drwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 /var/lib/mysql To fix it, I tried: semanage fcontext -d -e /var/lib/mysql this command returned: KeyError: /var/lib/mysql I tried restorecon anyway: restorecon -Rv /var/lib/my

Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread James Hogarth
On 23 Oct 2017 5:26 pm, "Bernard Fay" wrote: Interesting to see the Equivalence. As a first thing, I tried: semanage fcontext -a -e /var/lib/mysql.old /var/lib/mysql then restorecon -R /var/lib/mysql # semanage fcontext -lC SELinux fcontext type Context /home

Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread Bernard Fay
Interesting to see the Equivalence. As a first thing, I tried: semanage fcontext -a -e /var/lib/mysql.old /var/lib/mysql then restorecon -R /var/lib/mysql # semanage fcontext -lC SELinux fcontext type Context /home/users(/.*)? a

Re: [CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread James Hogarth
On 23 October 2017 at 13:33, Bernard Fay wrote: > Hello, > > A server was configured in /var/lib/myslq in the root fs. I added a LV > specifically for mysql. I stopped myql and renamed /var/lib/mysql to > /var/lib/mysql.old. I created a new dir /var/lib/mysql and mounted the LV > on /var/lib/my

[CentOS] Unable to apply mysqld_db_t to mysql directory

2017-10-23 Thread Bernard Fay
Hello, A server was configured in /var/lib/myslq in the root fs. I added a LV specifically for mysql. I stopped myql and renamed /var/lib/mysql to /var/lib/mysql.old. I created a new dir /var/lib/mysql and mounted the LV on /var/lib/mysql. I then copied with "cp -prZ" all mysql files in /var/l