After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Support for security such as Firewalls and securing linux

After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Postby musikbyg » 2011/11/04 14:13:14

Hello!

I changed the configuration for SELinux to disable it, and now I can't get into my Linux box, is in a virtual machine setup and I am very nervous I have lost
all the configurations made so far. Here is a snapshot of the screen:

[img align=left]http://www.affirmativeyou.com/virtual%20machine%20Linux.bmp[/img]

My CentOS 5.7 system will not boot ... I receive a:

Unable to load SELinux Policy. Machine is in enforcing mode. Halting now. Kernel Panic – not syncing : Attempting to kill init!

Then the boot process just stops and does nothing.

Question: Is there a way to recover form this and how do I recover?

Please help.

Thank You
musikbyg
 
Posts: 3
Joined: 2011/11/04 13:54:58

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Postby TrevorH » 2011/11/04 15:16:46

From the grub boot menu you should be able to hit Esc and get a list of the kernels that are available to boot. You can edit the command line parameters for these using grub. First thing to try is to append

Code: Select all
enforcing=0


to the end of the current list of parameters. If this fails then try appending selinux=0 instead.

How did you try to disable SELinux to get into this problem in the first place?
User avatar
TrevorH
Forum Moderator
 
Posts: 9146
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Postby musikbyg » 2011/11/04 15:38:04

I was trying to install the famous Bacula, and one of the instructions I found online said that I needed to disable SElinux temporarily in order to get it to work.
I did, and now I can't get past that error message.
I edited the /etc/selinux/config to a "permissive" state, and now I'm in this mess.

I tried what you suggested, and it didn't work.
Any other suggestions?

Thanks!
musikbyg
 
Posts: 3
Joined: 2011/11/04 13:54:58

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Postby musikbyg » 2011/11/04 16:06:01

I was able to get it back up, THANK YOU
musikbyg
 
Posts: 3
Joined: 2011/11/04 13:54:58

After disabling SELinux, machine not booting up - Unable to

Postby pschaff » 2011/11/07 01:49:25

For the sake of readers of this thread and future forum searchers please share your solution.

It is also not clear exactly what you changed to break the system. The usual approach is to just enter "setenforce 0" as root to temporarily disable SELinux by changing to Permissive mode. After performing any required operations then "setenforce 1" (or a reboot) will restore Enforcing mode.

For a permanent change one would use the GUI tool or edit /etc/sysconfig/selinux and change the line "SELINUX=enforcing" to "SELINUX=permissive" or "SELINUX=disabled" (not recommended).

I would have expected the GRUB argument to be "selinux=0".
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Postby TrevorH » 2011/11/07 02:02:33

I would have expected the GRUB argument to be "selinux=0".


That disables selinux, 'enforcing=0' should bring it up in permissive mode.
User avatar
TrevorH
Forum Moderator
 
Posts: 9146
Joined: 2009/09/24 10:40:56
Location: Brighton, UK


Return to CentOS 5 - Security Support

Who is online

Users browsing this forum: No registered users and 0 guests