How do I kill X?
I am accessing a computer via ssh and vnc. However I left it running in gnome. That sucks because it uses around 40MB of my 128MB RAM. So I want to kill X. I type
ps -A | grep X get the processnumber and kills it. Unfortunately it reappears right after with a new number and it still uses the same amount of memory. What do I do? I guess I could reboot it without it starting up in X. What file do I edit? Hope someone can help me out here..:-) |
Are you using the same user to kill the X process which you used to log in via ssh and vnc?
You might need to be root to kill the process. $kill -9 kill dash (minus sign) nine is kill with no mercy, so you might want to give that a try. I can't think of any reason why the process would respawn after a reboot though. |
Sounds like you've got your runlevel set for running via a GUI - this will respawn X as soon as it's shut down.
Check your /etc/inittab to find the runlevel you want, and switch into it with "telinit X" - where X is the number of the runlevel. |
To reboot without start X:
Edit /etc/init.d/dm comment the following line: case $1 in start) gprintf "Starting display manager: " # /etc/X11/prefdm & <===== comment this one success "Display manager startup" ret=$? echo if [ $ret = 0 ]; then touch /var/lock/subsys/dm fi ;; Then you can reboot, X won't start Note that this is on a Mandrake 10.0 might change depending on your distro |
It is true my /etc/inittab sets X to respawn. How exactly do I use telinit to change that? The line is
x:5:respawn:/etc/X11/prefdm -nodaemon in /etc/inittab. The kill -9 dosn't work. It still respawns. I prefer just to reboot the computer without it starting up in X. I just don't have the config files as you do in Mandrake. I use Fedora. |
Quote:
Why don't you try commenting it out (by adding a # at the begining of the line) and reboot? I suggest you make a copy of any of those /etc files before touching them. |
You can use telinit 3 this will take you out of X windows. Also if you look at the /etc/inittab, there is a line in there that sets the default run level. It should be set to 5 (graphical login), just change to 3 (text login). This way when you reboot X-windows will not be stated. While in text login, you can always start X windows via startx
|
Whenever I'm in graphical mode (runlevel 5) and I want to kill X temporarily to save memory, I type the command "/sbin/init 3" as root. This changes the system's runlevel to 3 until you reboot.
If you want to use runlevel 3 (the command-line-only mode) as the default runlevel, then just edit your /etc/inittab file like people have been saying so far. |
All times are GMT -5. The time now is 12:31 AM. |