How to fix Failed to Load SELinux Policy error

General support questions
DangerDane
Posts: 14
Joined: 2014/12/05 09:52:36

Re: How to fix Failed to Load SELinux Policy error

Post by DangerDane » 2015/01/01 19:41:56

I suspect the IT people in charge hasn't actually attached the ISO image nor has set it up for DVD boot

jakke
Posts: 2
Joined: 2015/12/09 03:38:21

Re: How to fix Failed to Load SELinux Policy error

Post by jakke » 2017/07/03 16:30:33

Just because there is no follow-up on this and I encountered a similar problem:

I started up my virtual machine by editing grub (press 'e' when the grub menu appears), look for the line starting with 'linux16' and add 'selinux=0' as one of the parameters (without quotes). Press Ctrl-x to boot while skipping SELinux.

Once the system has started, 'yum reinstall selinux-policy-targeted' and reboot the system. Problem fixed.
Please note that it can take a while because the system needs to relable for SELinux to work correctly.

I had this problem on CentOS 7 after upgrading my VirtualBox host and vbox addons.
I used https://asafshoval.wordpress.com/2014/1 ... ing-linux/ as a reference together with this thread to resolve the issue.
Thanks for the suggestion to reinstall selinux, that did the trick. There's no need to start up from a boot cd/dvd, just edit grub like I did.

c.karol
Posts: 1
Joined: 2017/07/19 13:40:52

Re: How to fix Failed to Load SELinux Policy error

Post by c.karol » 2017/07/19 13:43:01

Hi,

I having same problem. I receive "Failed to load SELinux policy, freezing".

I am using Finnix ISO to boot, but when I am looking for /etc/selinux/config, the configuration file is missing.

Thanks in advance!

antitrust
Posts: 1
Joined: 2017/09/09 03:41:05

Re: How to fix Failed to Load SELinux Policy error

Post by antitrust » 2017/09/09 03:53:07

This would work on version 7 that is not HARDENED enough :), This would allow you to login to the system, to disable SELINUX(because you cant get in with it running) and do your TROUBLESHOOTING once you get IN. please follow carefully:
1. reboot
2. on the load screen, select the kernel you are using, DON'T hit enter. but on your keyboard type "e"
3. find that line that starts with "linux16", on the end of that line insert "rd.break"
4. now you will be able to login and type commands from there, so type in "mount -o remount,rw /sysroot"
5. then type in --> "chroot /sysroot"
6. Set the selinux to disabled "sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' "
7. type in exit, exit

User avatar
TrevorH
Forum Moderator
Posts: 30785
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2017/09/09 10:26:46

That's a lot of steps when you could just append selinux=0 to the end of the kernel command line at the grub prompt and boot up once.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

polarorbit
Posts: 3
Joined: 2018/02/15 04:33:18

Re: How to fix Failed to Load SELinux Policy error

Post by polarorbit » 2018/04/10 20:44:48

I just ran into this problem and used selinux=0 from GRUB to get into my system. Once there, I was able to determine the actual cause of the problem so I thought I would share. The cause of the problem was that when I modified /etc/sysconfig/selinux in order to disable SELinux, I accidentally did this:

Code: Select all

SELINUXTYPE=disabled

When I should have done this:

Code: Select all

#SELINUXTYPE=targeted
SELINUX=disabled
Once I corrected this my system boots just fine. I hope this helps someone resolve their problem.

User avatar
TrevorH
Forum Moderator
Posts: 30785
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2018/04/10 22:42:00

We don't recommend disabling it at all. If you need to find out if selinux is responsible for a problem then running setenforce 0 as root will put it into permissive mode which will allow all access and log what it would have denied. From that info you can use the wiki page to either turn on a boolean to allow what was denied or create a custom policy - takes a few minutes.

Useful resources for SELinux: http://wiki.centos.org/HowTos/SELinux | http://wiki.centos.org/TipsAndTricks/SelinuxBooleans | http://docs.fedoraproject.org/en-US/Fed ... ced_Linux/ | http://www.youtube.com/watch?v=bQqX3RWn0Yw | http://opensource.com/business/13/11/se ... licy-guide
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Andreixe
Posts: 1
Joined: 2018/08/17 22:46:42

Re: How to fix Failed to Load SELinux Policy error

Post by Andreixe » 2018/08/17 22:59:39

That's a real bug somehow.

I know that it's may not be secure to disable it but it may be done for practical and temporary purpose, even if Selinux can be disabled for a session time. I alos made some modifications in Selinux policies, and after a while, i decided to disabled it just for some days.

I wonder why there is the disable option if lead to freezing Centos ?

Post Reply

Return to “CentOS 7 - General Support”