如何处理CentOS Failed to load SELinux policy
CentOS 7在启动时,卡在进度条界面一直进不去系统,如下图所示:

我们可以通过按键盘的左右方向键,可以看到提示“Failed to load SELinux policy.”,这就是造成系统一直卡住无法正常启动的原因。

原因
是因为没有正确修改系统的selinux的配置,导致系统在启动时报selinux的错误
解决方案
第一步:先重启CentOS7操作系统,在出现开机界面时按下向上或者向下方向键,以便开机界面停留下。然后选择第一行,按字母 e 进行编辑

第二步:进入编辑界面(其实是 CentOS 7 的启动选项),按向下方向键定位到“linux16”开头的一行,再按向右方向键找到“LANG=zh_CN.UTF-8”

第三步:在末尾以空格间隔后加上 selinux=0

第四步:按下Ctrl + x 键,就可以进入登录界面

第五步:以 root 用户登录成功后,执行以下命令,主要调整以下两行
1)SELINUX=disabled
2)SELINUXTYPE=targeted
[root@localhost ~]# vi /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
最后,wq保存配置,然后再重启系统就可以正常启动了
版权声明:
作者:郭靖
链接:https://www.sxszhian.com/archives/4764
来源:上海永驰网络科技有限公司
文章版权归作者所有,未经允许请勿转载。
THE END
二维码
打赏

