How to fix Failed to Load SELinux Policy error

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

How to fix Failed to Load SELinux Policy error

Post by DangerDane » 2014/12/28 15:20:04

We have a CentOS server setup running Kannel for SMS sending and were experiencing issues with transmission and restarted the server. Once the server was restarted it hangs at "Failed to load SELinux Policy. Freezing."

Any good ideas or suggestions how to fix this so we get the server back up and running right away as its a production server.

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

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2014/12/28 15:32:23

Boot up and append selinux=0 to the kernel command line via grub. If that doesn't work then you may need to boot from rescue media and reinstall selinux-policy-targeted. There was/is a bug in the 6.6 installer where it installs that package in the wrong order and the post script from it tries to run commands that are not yet installed so they fail. This means that the policy is not generated correctly and an early 6.6 kernel managed to boot despite this but that was then fixed in a later one so it dies instead. You may also be able to boot with the original 6.6 kernel.

Hmm, wait, you posted in the CentOS 7 section... is this el7 or el6?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: How to fix Failed to Load SELinux Policy error

Post by DangerDane » 2014/12/28 15:51:45

Its version 7 :). I am pretty new to this so any straight forward instructions or pointers is much appreciated. But doing that thing that you suggest won't that negative impact on the GUI.

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

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2014/12/28 17:21:57

You'll need to repair this at the command line but this is not the problem that I thought it was since that affects CentOS 6.6 fresh installs only. I'd still follow the same steps but in your case I think I'd skip straight to boot from rescue media and reinstall the selinux-policy-targeted package.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: How to fix Failed to Load SELinux Policy error

Post by DangerDane » 2014/12/28 17:54:45

How would I go about doing that on a virtual machine?. I can get someone to give me bios access, and get it to boot from installation media, but does the installation disc "discover" that it can repair or are there some specific steps I should follow in order to install that package from install media?

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

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2014/12/28 18:21:54

Boot from the install media in rescue mode: there's a special option for that off the bottom menu item. That'll ask if it should mount your current install for you and if you say yes then it'll do so on /mnt/sysimage. Drop to a command prompt and chroot /mnt/sysimage and now you are in your installed system as root and you can yum reinstall selinux-policy-targeted. After that I would also touch /.autorelabel and then reboot.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: How to fix Failed to Load SELinux Policy error

Post by DangerDane » 2014/12/28 18:32:51

And that should fix the issue?

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

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2014/12/28 21:19:41

I have no idea. I'm just suggesting options for you to try and have no idea if they will work.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

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 14:41:40

It didn't ask if I want to mount the existing setup. It just boots straight into rescue and fails with the same error?. It doesn't prompt me in regards to mounting the existing installation or not.

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

Re: How to fix Failed to Load SELinux Policy error

Post by TrevorH » 2015/01/01 17:57:25

You mean the rescue boot fails with the exact same error? I find that difficult to believe since it's on the DVD and takes no notice of the installed system at all.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply