LinuxSir.cn,穿越时空的Linuxsir!

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

用什么命令可以退出X,并且释放X所占用的资源呢?

[复制链接]
发表于 2006-12-5 03:54:00 | 显示全部楼层 |阅读模式
我对LINUX的命令掌握得不是很全面,有些工作需要在X下用鼠标完成。我想在完成这些工作后,退出X,以便留出更多的资源给apache和mqsql用。

请问用什么命令可以实现呢?   init 3 ?

再用什么命令可以回到X?   init 5 ?
发表于 2006-12-5 08:39:46 | 显示全部楼层
/etc/inittab
回复 支持 反对

使用道具 举报

发表于 2006-12-5 10:48:15 | 显示全部楼层
su -
init 3

这样就init 3 了


如果init 1 那么就单用户模式了
回复 支持 反对

使用道具 举报

发表于 2006-12-5 12:30:31 | 显示全部楼层
可不可以加以个启动相在grub里,
实现既可以登录图形界面又可以
登录命令行界面?
回复 支持 反对

使用道具 举报

发表于 2006-12-5 13:24:44 | 显示全部楼层
在menu.lst中多弄2个title,给kernel的参数分别多个3和5,就可以在开机时通过菜单选择进入console还是X了~
回复 支持 反对

使用道具 举报

发表于 2006-12-5 13:33:18 | 显示全部楼层
  1. /etc/init.d/gdm stop#停止x
  2. /etc/init.d/gdm start#启动x
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-5 17:14:03 | 显示全部楼层
Post by shael
  1. /etc/init.d/gdm stop#停止x
  2. /etc/init.d/gdm start#启动x
复制代码



不行啊,没什么反应



[root:/etc/init.d]#gdm stop
gdm 已经运行。中止!
[root:/etc/init.d]#gdm start
gdm 已经运行。中止!
[root:/etc/init.d]#gdm restart
gdm 已经运行。中止!
回复 支持 反对

使用道具 举报

发表于 2006-12-5 17:22:01 | 显示全部楼层
Post by K.s
在menu.lst中多弄2个title,给kernel的参数分别多个3和5,就可以在开机时通过菜单选择进入console还是X了~


我的menu.lst文件如下:
default=0
timeout=20
splashimage=(hd0,8)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4)
        root (hd0,8)
        kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.11-1.1369_FC4.img
title SHUER XP
        rootnoverify (hd0,0)
        chainloader +1
改怎样修改阿,谢谢!

另外,我在终端理以init 3
或crt+alt+F2或F3
然后黑屏无任何反应!
回复 支持 反对

使用道具 举报

发表于 2006-12-5 21:38:11 | 显示全部楼层
FC4的确是有crt+alt+Fn黑屏的问题,没记错的话在linuxeden有解决的办法,自己去找找。
回复 支持 反对

使用道具 举报

发表于 2006-12-5 22:45:09 | 显示全部楼层
来点英文,人家写的清楚
Determining the Default Boot runlevel

The default boot runlevel is set in the file /etc/inittab with the initdefault variable. When set to 3, the system boots up with the text interface on the VGA console; when set to 5, you get the GUI. Here is a snippet of the file (delete the initdefault line you don't need):

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:                         # Console Text Mode
id:5:initdefault:                         # Console GUI Mode


Note the following:

    * Most home users boot up with a Windows like GUI (runlevel 5)
    * Most techies will tend to boot up with a plain text-based command-line-type interface (runlevel 3)
    * Changing initdefault from 3 to 5, or vice-versa, has an effect upon your next reboot. See the following section on how to get a GUI login all the time until the next reboot.
    * Of course, don't set the initdefault value to 6 or your system will constantly reboot. Setting it to 0 will never allow it to start!


意思大概是
修改  /etc/inittab
改成
id:3:initdefault:                         # Console Text Mode
原来是
id:5:initdefault:                         # Console GUI Mode
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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