LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-29-2004, 02:58 PM   #1
aargh
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Rep: Reputation: 0
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..:-)
 
Old 10-29-2004, 03:05 PM   #2
n0b1x
LQ Newbie
 
Registered: Mar 2004
Location: US
Distribution: RedHat 9, Gentoo, Suse 9.1
Posts: 17

Rep: Reputation: 0
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.
 
Old 10-29-2004, 03:07 PM   #3
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 47
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.
 
Old 10-29-2004, 03:07 PM   #4
jeickal
Member
 
Registered: Oct 2004
Distribution: Mandrake, DSL, SuSE, RedHat
Posts: 71

Rep: Reputation: 15
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
 
Old 10-29-2004, 03:36 PM   #5
aargh
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Original Poster
Rep: Reputation: 0
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.
 
Old 10-29-2004, 04:33 PM   #6
jeickal
Member
 
Registered: Oct 2004
Distribution: Mandrake, DSL, SuSE, RedHat
Posts: 71

Rep: Reputation: 15
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.
 
Old 10-29-2004, 10:01 PM   #7
sfwalter
LQ Newbie
 
Registered: Oct 2004
Posts: 12

Rep: Reputation: 0
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
 
Old 10-30-2004, 02:52 PM   #8
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What if 'kill -9' fails to kill a task? chii-chan Linux - Newbie 15 03-27-2013 04:47 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 07:35 PM
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 08:18 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 03:32 PM
kill X = kill computer! jd243 Slackware 3 07-02-2003 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration