centos 7.x 错误设置selinux 导致不能启动 Failed to load SELinux policy. Freezing

今天本博客售后的时候,遇到一个问题,centos 7.x重启后机器就报 Failed to load SELinux policy. Freezing 错误导致一直不能启动。怎么解决了,百度了一下,其实相当简单的。

解决办法

1. 重启时在启动页面,选择你要启动的内核 按 e, 进入 grub 编辑页面。

2. 找到 linux16 那一行,在language 后面 也就是LANG=zh_CN.UTF-8,空格 加上 selinux=0 或者 enforcing=0 (备注:我是加入selinux=0 生效的。)

3. 然后 ctrl + x 启动,就看到熟悉的登录界面。

4 .修改selinux配置文件,正确关闭selinux ~!

vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#    enforcing - SELinux security policy is enforced.
#    permissive - SELinux prints warnings instead of enforcing.
#    disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#    targeted - Targeted processes are protected,
#    minimum - Modification of targeted policy. Only selected processes are protected. 
#    mls - Multi Level Security protection.
SELINUXTYPE=targeted

修改完毕后,重启。查看是否会报错 。over。

教程参考:
https://www.cnblogs.com/yoyotl/p/7489048.html
https://blog.51cto.com/qulei616/1933840