MySQL rpm install & SElinux

Issues related to applications and software problems
Post Reply
Ziris85
Posts: 5
Joined: 2014/11/19 08:19:15

MySQL rpm install & SElinux

Post by Ziris85 » 2014/11/19 08:43:52

Hey folks,

So I've been trying for several days now to get MySQL via the RPM bundle running, instead of using the new repo offering. I can get it installed and everything just fine, but when I tried to start the sevice using the bundled init script, SElinux jumps in the way with a denial:
type=AVC msg=audit(1414205449.021:546): avc: denied { execmem } for pid=14976 comm="mysqld" scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:system_r:mysqld_t:s0 tclass=process
I'm fairly certain that contexts and everything are as they should be, but to be sure, I ran

Code: Select all

restorecon -R /*
I was first wondering if it might have something to do with the fact that it's an init script, rather than a systemd script, so I grabbed the systemd script that's provided from the repo version and tried using that with the same failure. When I tried using the sealert tool for suggestions, the only thing it could come up with was that it was a bug, and that I could create a custom policy to allow it. However, I don't feel like that should be necessary, since following the exact installation procedure in CentOS 6 works fine. I should also mention that the version from the repo's DOES work, though when I did a side-by-side comparison of the two installations, I was unable to find a difference (other than the repo version having man pages). I can also invoke the

Code: Select all

mysqld_safe
command directly and THAT will allow it to run as well.

In light of all that info, I really feel like I'm missing something simple and obvious, but I'll be darned if I can find it. Any suggestions or thoughts would be appreciated (short of disabling SElinux - something I don't want to do).

Thanks.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: MySQL rpm install & SElinux

Post by TrevorH » 2014/11/19 08:55:42

CentOS 7 supplies mariadb which is a drop-in replacement for mysql.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Ziris85
Posts: 5
Joined: 2014/11/19 08:19:15

Re: MySQL rpm install & SElinux

Post by Ziris85 » 2014/11/19 13:58:05

Hey TrevorH, thanks for the reply!

Yes, I'm aware that MariaDB is now shipped by default. I'm just exploring my options at the moment, and for folks who might want bona-fide MySQL (for whatever various reasons), I'd like to see if we can figure out why SElinux isn't having it, as it were.

Any thoughts on that front?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: MySQL rpm install & SElinux

Post by TrevorH » 2014/11/19 14:15:17

It would be because the people that made the packages didn't bother to test it with selinux turned on. Mariabdb is writen by the original mysql authors, the ones who sold it to Sun before Sun were acquired by Oracle. It's a fork of the mysql code at the time of the disagreement over future direction of the product. To that extent, it's probably more mysql than mysql is and mariadb is now the default mysql in almost all distros.

The table of who uses mariadb as the default mysql https://mariadb.com/kb/en/mariadb/docum ... e-mariadb/ is interesting...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply