LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 678|回复: 9

X-window问题,查了论坛没有答案,所以发问!清指点!

[复制链接]
发表于 2005-1-12 20:54:08 | 显示全部楼层 |阅读模式
我执行的操作(是以root执行的):
1.默认boot up runlevel: 3 (text mode)
2.startx能打开x-server
3.(关键在这)打开terminal, 运行init 5
5.转入graphic mode
6.reboot
上面的操作是正规的 ,系统没有任何报错,也没有对系统参数作任何修改

问题:
1。以text mode登录,输入用户名root和密码后,执行startx,系统没有报错,提示:
waiting for x-serve to shut dow,重新回到text mode,
2.然后startx无法启动图形界面
3。接着输入init 5,就能进入图形界面了
怎么回事?奇怪!
help please
发表于 2005-1-12 22:22:33 | 显示全部楼层
家目录下.xinitrc 或.xsession中执行的程序不对或未定义要启动的桌面环境。
 楼主| 发表于 2005-1-12 22:47:58 | 显示全部楼层
thanks!
your suggestion is reasionable.
i'm using Redhat 9.0 and there's none of the said file in the /home directory and nor are they anywhere else, i build them both!
now what to do next?
hwo to cope wit it?
any more suggestions?
发表于 2005-1-12 22:56:21 | 显示全部楼层
run switchdesk  gnome              if you want to use gnome
or  switchdesk kde                    if you want to use kde
then run startx
 楼主| 发表于 2005-1-13 10:53:55 | 显示全部楼层
谢谢!
我在图形界面登录时将gnome设置成default for future sessions,先试试这个。
然后看看行否
否则就只有执行您提供的命令了 !
 楼主| 发表于 2005-1-13 11:36:04 | 显示全部楼层
没办法了
startx不能打开图形界面
只能用命令了
-----
家目录下.xinitrc 或.xsession中执行的程序不对或未定义要启动的桌面环境。
-------
能详细帮我一下,怎么设置么?
thanks
 楼主| 发表于 2005-1-13 13:16:24 | 显示全部楼层
贴上这个,但愿对所有有此问题的人有帮助!
----
5. Running XFree86

With your XF86Config file configured, you're ready to fire up the X server and give it a spin. First, be sure that /usr/X11R6/bin is on your path.

The command to start up XFree86 is

startx

This is a front-end to xinit (in case you're used to using xinit on other UNIX systems).

This command will start the X server and run the commands found in the file .xinitrc in your home directory. .xinitrc is just a shell script containing X clients to run. If this file does not exist, the system default /usr/X11R6/lib/X11/xinit/xinitrc will be used.

A standard .xinitrc file looks like this:

#!/bin/sh

xterm -fn 7x13bold -geometry 80x32+10+50 &
xterm -fn 9x15bold -geometry 80x34+30-10 &
oclock -geometry 70x70-7+7 &
xsetroot -solid midnightblue &

exec fvwm2

This script will start up two xterm clients, an oclock, and set the root window (background) color to midnightblue. It will then start up fvwm2, the window manager. Note that fvwm2 is executed with the shell's exec statement; this causes the xinit process to be replaced with fvwm2. Once the fvwm2 process exits, the X server will shut down. You can cause fvwm2 to exit by using the root menus: depress mouse button 1 on the desktop background -- this will display a pop up menu which will allow you to Exit Fvwm2.

Be sure that the last command in .xinitrc is started with exec, and that it is not placed into the background (no ampersand on the end of the line). Otherwise the X server will shut down as soon as it has started the clients in the .xinitrc file.

Alternately, you can exit X by pressing ctrl-alt-backspace in combination. This will kill the X server directly, exiting the window system.

The above is a very, very simple desktop configuration. Many wonderful programs and configurations are available with a bit of work on your .xinitrc file.

If you are new to the X Window System environment, we strongly suggest picking up a book such as The Joy of X: An Overview of the X Window System by Niall Mansfield (Addison-Wesley 1993, ISBN 0201-565129). Using and configuring X is far too in-depth to cover here. See the man pages for xterm, oclock, and fvwm2 for clues on getting started.
------
quoted from
http://www.linuxforum.com/linux-xfree86/x121.html
 楼主| 发表于 2005-1-13 13:18:04 | 显示全部楼层
the key sentence shoud be:
Be sure that the last command in .xinitrc is started with exec, and that it is not placed into the background (no ampersand on the end of the line). Otherwise the X server will shut down as soon as it has started the clients in the .xinitrc file.
 楼主| 发表于 2005-1-13 13:41:23 | 显示全部楼层
解决方法:将两位的建议加到.xinitrc中就ok了
#!/bin/sh
#the folowing two lines are from /etc/X11/xinitrc of my own os
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &
#these tow lines are suggested commands
switchdesk gnome
start x
# this last line may not be necessary
#exec fvwm2
-------
conclusion: edit .xinitrc elegantly may solve wierd problems
 楼主| 发表于 2005-1-13 14:03:05 | 显示全部楼层
补充:
方法一:
在加入命令前,请在text mode的登录界面的提示符下运行
#switchdesk gnome/root/.xinitrc.switchdesk
让Linux创建文件
/root/.xinitrc.switchdesk
then add the suggested commands into the file: /root/.xinitrc.switchdesk

方法2: (sorry, chinese input method platform plunged into death, so i've to use english)
add the suggested commands to /root/.xinitrc
then back to text mode log on prompt #
run "switchdesk gnome", keep an eye on the message then poped up
remeber that this will lead every of your log-in into the Gnome panel
run startx
---
now startx will lead u to gnome with default runlevel 3
good luck!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表