LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-06-2015, 09:55 AM   #1
smartdba
LQ Newbie
 
Registered: Jul 2015
Posts: 4

Rep: Reputation: Disabled
Smile mysql service fail to restart due to selinux


Hi Linux Gurus
I am trying to investigate a specific issue with the some of our mysql installations. They all appear to be working fine until, I restart them. If I restart the service, the selinux is stopping me from doing so. I can disable selinux or semange the data folders to make them work, but I was wondering how they worked before. Running systems have selinux enforced and targeted, but the mysql daemons are running in unconfined domain
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 21559 ? 00:00:00 mysqld_safe
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 21929 ? 11:36:56 mysqld

So how did these running mysql daemons start on a system with selinux configured and running in unconfined domains(ie, that's until I restart them)? Did the old sysadmin use some commands to temporarily exclude mysql daemons from selinux until next reload?

Thank you!

Joe
 
Old 07-06-2015, 12:02 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
http://selinuxproject.org/page/Main_Page
 
Old 07-07-2015, 04:54 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by smartdba View Post
(..) but I was wondering how they worked before.
If you want to make this work and you have installed a stock Selinux policy and RPM packages then you 'grep mysql /var/log/audit/audit.log|audit2allow;' and build your local policy. If you OTOH want to mimick behaviour as configured by previous admins you have to investigate a combination of documentation, shell history, audit log, booleans usage, local Selinux policy and init script modifications where applicable and if sufficient records were kept.
 
1 members found this post helpful.
Old 07-14-2015, 08:27 AM   #4
smartdba
LQ Newbie
 
Registered: Jul 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
mysql service fail to restart due to selinux

Thanks unSpawn.

I figured out how they did it. Not the best or secured way, i guess

They created an unconfined daemon from the original mysql startup script so the process will start without the selinux protection.

ls -lZ mysql*

-rwx------. 1 unconfined_uobject_r:etc_t:s0 root root 10815 Dec 11 2013 mysqld (sysadmins created)
-rwxr-xr-x. 1 system_uobject_r:initrc_exec_t:s0 root root 10815 Mar 25 13:01 mysql

I will semanage the new folders for to make this right as explained here.. (http://crashmag.net/change-the-defau...elinux-enabled

dba
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fail to install SendIP on Cygwin due to failed dependencies Alexanderok Linux - Newbie 2 02-23-2011 01:59 PM
Service postfix restart fail/domain name config cmwalter Linux - Server 2 03-05-2010 03:16 PM
Backups (tar and gzip) fail due to auditd -- please help jdh239 Linux - Server 1 11-07-2007 12:08 PM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM
SELinux cause Squirrelmail to fail cojo Linux - Security 2 11-20-2005 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration