在将机器从文字模式调整到图形模式时,重启系统后,系统一直启动不来图形界面,通过telnet进行,查看/var/log/messages ,系统启动报错,内容如下:
Aug 11 17:16:30 localait init: prefdm main process (1235) terminated with status 1
Aug 11 17:16:30 localait init: prefdm main process ended, respawning
Aug 11 17:16:30 localait init: prefdm main process (1266) terminated with status 1
Aug 11 17:16:30 localait init: prefdm main process ended, respawning
Aug 11 17:16:30 localait init: prefdm main process (1283) terminated with status 1
Aug 11 17:16:30 localait init: prefdm main process ended, respawning
Aug 11 17:16:31 localait init: prefdm main process (1300) terminated with status 1
Aug 11 17:16:31 localait init: prefdm main process ended, respawning
Aug 11 17:16:31 localait init: prefdm main process (1317) terminated with status 1
Aug 11 17:16:31 localait init: prefdm main process ended, respawning
Aug 11 17:16:31 localait init: prefdm main process (1334) terminated with status 1
Aug 11 17:16:31 localait init: prefdm main process ended, respawning
Aug 11 17:16:31 localait init: prefdm main process (1351) terminated with status 1
Aug 11 17:16:31 localait init: prefdm main process ended, respawning
Aug 11 17:16:32 localait init: prefdm main process (1368) terminated with status 1
Aug 11 17:16:32 localait init: prefdm main process ended, respawning
Aug 11 17:16:32 localait init: prefdm main process (1385) terminated with status 1
Aug 11 17:16:32 localait init: prefdm main process ended, respawning
Aug 11 17:16:32 localait init: prefdm main process (1402) terminated with status 1
Aug 11 17:16:32 localait init: prefdm main process ended, respawning
Aug 11 17:16:32 localait init: prefdm main process (1419) terminated with status 1
Aug 11 17:16:32 localait init: prefdm respawning too fast, stopped
也就是说init调用 prefdm的时候,系统启动不了,prefdm是负责启动X环境的,通过init进程调度prefdm脚本启动报上述错误,但是使用startx启动,却能正常启动,问题在哪呢?
通过分析脚本,发现要kdm ,gdm这些管理工具都没装,于是再通过yum安装kdm, 当安装完重新启动后,还是启动失败,不过问题已经发生变化了,错误信息如下:
ait avahi-daemon[1102]: Service "localait" (/services/ssh.service) successfully established.
Aug 11 17:45:41 localait kdm[1193]: X server "/usr/bin/X" cannot be executed
Aug 11 17:45:41 localait kdm[1174]: X server for display :0 cannot be started, session disabled
X 不能执行,在/usr/bin/X 发现找不到X. 一种可能是X不存在,一种是配置不对,按照鸟哥私房菜上说的X启动过程如下:
-
X server 的參數方面:
-
使用 startx 後面接的參數;
-
若無參數,則找尋使用者家目錄的檔案,亦即 ~/.xserverrc
-
若無上述兩者,則以 /etc/X11/xinit/xserverrc
-
若無上述三者,則單純執行 /usr/bin/X (此即 X server 執行檔)
-
X client 的參數方面:
-
使用 startx 後面接的參數;
-
若無參數,則找尋使用者家目錄的檔案,亦即 ~/.xinitrc
-
若無上述兩者,則以 /etc/X11/xinit/xinitrc
-
若無上述三者,則單純執行 xterm (此為 X 底下的終端機軟體)
也就是说Xserverrc不存在的情况下才启动不来, 有可能就是没有安装X Server导致, rpm -qa|grep X11-server-Xorg 不存在,接下来使用如下命令安装
yum -y install xorg-x11-server-Xorg
安装之后,reboot 下 X 窗口出现了。
阅读(2634) | 评论(0) | 转发(0) |