LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I kill X? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-kill-x-248834/)

aargh 10-29-2004 01:58 PM

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..:-)

n0b1x 10-29-2004 02:05 PM

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.

oneandoneis2 10-29-2004 02:07 PM

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.

jeickal 10-29-2004 02:07 PM

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

aargh 10-29-2004 02:36 PM

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.

jeickal 10-29-2004 03:33 PM

Quote:

Originally posted by aargh
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

use Fedora.

I don't know Fedora very well, but this looks like the line I commented out on my Mandrake.
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.

sfwalter 10-29-2004 09:01 PM

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

vincebs 10-30-2004 01:52 PM

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 07:17 PM.