Enforcing mode requested but no policy loaded. Halting now. kernel panic - not syncing: Attempted to kill init!

来源:互联网 发布:霍勒斯.格兰特数据 编辑:程序博客网 时间:2024/05/04 20:08

在vmware下面,新编译的内核,启动出现问题:
Enforcing mode requested but no policy loaded. Halting now.
kernel panic - not syncing:  Attempted to kill init!

解决方法:
1、在grub.conf里把 kernel /vmlinuz-2.6.19 ro root=LABEL=/ rhgb quiet 变为:kernel /vmlinuz-2.6.19 ro root=LABEL=/ enforcing=0 rhgb quiet
2、修改/etc/selinux/config配置文件,只要把SELINUX的值改成disabled就好了

原因:
selinux的问题。
enforcing参数是在启动内核时传递给selinux的内核参数,它用来决定你系统的内核运行于 强制(enforcing )模式还是自由(permissive) 模式。
在自由模式下SELinux只是记录他该做什么,而事实上并不做任何动作。在强制模式下SElinux会来真格的。如果你的策略有错误,在强制模式下系统可能会阻止你登陆!所以正常情况下你应改在启动时传 enforcing=1给内核,当你的SELinux策略有问题时,你可以临时传enforcing=0给内核来查错。在/etc/selinux/config这个init的配置文件中相应的有一个选项,通过设置它,也可以使系统进入自由模式。

参考:
http://www.kernelchina.org/?q=node/103
http://ciwnet.blog.sohu.com/64878437.html
http://linux.chinaunix.net/bbs/thread-903538-1-1.html