新装了台fedora20的虚拟机,安装升级了一些东西后。启动时过了fedora的logo画面后就是黑屏。
也没提示不论什么错误,好在shell还能进去。查看/var/log/anaconda/syslog日志,发现错误例如以下:
20:40:34,794 NOTICE kernel:[ 1256.967907] type=1400 audit(1409517634.790:29): avc: denied { read write } for pid=26214 comm="ldconfig" path="/dev/pts/0
" dev="devpts" ino=3 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=chr_file
1770 20:40:34,794 NOTICE kernel:[ 1256.970292] type=1400 audit(1409517634.792:30): avc: denied { read } for pid=26214 comm="ldconfig" path="/proc/1025/mount
s" dev="proc" ino=17433 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=file
1771 20:41:02,416 NOTICE kernel:[ 1284.579392] type=1400 audit(1409517662.415:31): avc: denied { write } for pid=30896 comm="ldconfig" path="/var/tmp/dracut
-log.IKiLpk/systemd-cat" dev="sda5" ino=275146 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=fifo_file
1772 20:41:02,419 NOTICE kernel:[ 1284.581518] type=1400 audit(1409517662.417:32): avc: denied { read } for pid=30896 comm="ldconfig" name="ld.so.conf.d" de
v="sda5" ino=276572 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
1773 20:41:02,424 NOTICE kernel:[ 1284.586709] type=1400 audit(1409517662.422:33): avc: denied { write } for pid=30896 comm="ldconfig" name="etc" dev="sda5"
ino=275151 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
1774 20:41:02,424 NOTICE kernel:[ 1284.586723] type=1400 audit(1409517662.422:34): avc: denied { add_name } for pid=30896 comm="ldconfig" name="ld.so.cache~
" scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
1775 20:41:02,424 NOTICE kernel:[ 1284.586747] type=1400 audit(1409517662.422:35): avc: denied { create } for pid=30896 comm="ldconfig" name="ld.so.cache~"
scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
1776 20:41:02,424 NOTICE kernel:[ 1284.586853] type=1400 audit(1409517662.422:36): avc: denied { setattr } for pid=30896 comm="ldconfig" name="ld.so.cache~"
dev="sda5" ino=276580 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
1777 20:41:02,424 NOTICE kernel:[ 1284.586879] type=1400 audit(1409517662.422:37): avc: denied { remove_name } for pid=30896 comm="ldconfig" name="ld.so.cac
he~" dev="sda5" ino=276580 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
1778 20:41:02,424 NOTICE kernel:[ 1284.586888] type=1400 audit(1409517662.422:38): avc: denied { rename } for pid=30896 comm="ldconfig" name="ld.so.cache~"
dev="sda5" ino=276580 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
1779 20:41:20,086 NOTICE kernel:[ 1302.240139] type=1400 audit(1409517680.084:39): avc: denied { read write } for pid=34152 comm="adduser" path="/dev/mapper
/control" dev="devtmpfs" ino=8956 scontext=system_u:system_r:useradd_t:s0 tcontext=system_u:object_r:lvm_control_t:s0 tclass=chr_file
这说明一些操作被拒绝了。抽取第一条来看。avc: denied代表操作被拒绝。{ read write }
代表该操作须要读-read
和 写-write
许可。pid=
26214代表进程号为1876的进程试图运行操作……等等。
这些是SELINUX的安全检查,内核在运行系统调用前会询问 SELinux 进程是否获得了运行操作的授权。
解决的办法也非常easy,就是对对应的进程进行授权,或是关闭SELINUX,这里。我选择后者,改动文件/etc/selinux/config,将当中的
SELINUX=enforcing
改动为
SELINUX=disabled
重新启动后即可了。