LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2002, 01:11 AM   #1
Joshsawyer77
LQ Newbie
 
Registered: Dec 2002
Location: Milwaukee
Distribution: Mandrake
Posts: 22

Rep: Reputation: 15
kill X windows


I need to know how to close xwindows and run my box from the command prompt. My system boots into x windows and that's fine but once i am in it how do I shut down it down? I did a killall x but that did not seem to stop it.
 
Old 12-30-2002, 01:27 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Switch to a console:
CTRL ALT F2
Then as root type:
init 3

Depending on your distro, and what /etc/inittab says adjust the 3 to switch to your non gui state. Most distro's are init 3 though.

Cool
 
Old 12-30-2002, 02:46 AM   #3
then
Member
 
Registered: Oct 2002
Location: FDR India
Distribution: RH9, Knoppix, MEPIS
Posts: 65

Rep: Reputation: 15
Re: kill X windows

Quote:
Originally posted by Joshsawyer77
I need to know how to close xwindows and run my box from the command prompt. My system boots into x windows and that's fine but once i am in it how do I shut down it down? I did a killall x but that did not seem to stop it.
Open the xterm (or any shell you have) and type telinit 3 or init 3 as **root** to go to runlevel-3.

If you don't want X to start at boot, then as MasterC said, change the run-level in your /etc/inittab file to 3. Run-level 3 will start all services (incl. network services) but WILL NOT start X.

IMHO one needs to be careful before issuing any kill command, its not to be trifled with. Please the read the manual for kill before you start killing

HTH
theN
 
Old 12-30-2002, 02:51 AM   #4
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
If you manually started X (startx) then the fastest way (imho) to shut it down again is to press <ctrl><alt> and <backspace> together.
 
Old 12-30-2002, 05:12 AM   #5
then
Member
 
Registered: Oct 2002
Location: FDR India
Distribution: RH9, Knoppix, MEPIS
Posts: 65

Rep: Reputation: 15
Quote:
Originally posted by iceman47
If you manually started X (startx) then the fastest way (imho) to shut it down again is to press <ctrl><alt> and <backspace> together.
that never worked for me.

KDE on my RH8 does not put me at init3 with Ctrl+Alt+Backspace. The key-combo *restarts* X instead of *shutting* it down. Worse, sometimes the system crashes leaving me with a blank screen and blinking Caps- & Scroll-lock LEDs. Then I end up doing a cold reboot

Truth is, I've never bothered to find out why coz I got used to init3 or Alt+F1...F6

Regards
theN
 
Old 12-30-2002, 05:26 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Restarting or killing X with CTRL ALT BACKSPACE is related to which run level you boot into. That's why iceman47 said if you manually start X (with startx) then you can kill it with CTRL ALT BACKSPACE. This is in runlevel 3 on most distros. If you are runlevel 5 in most distros, which usually is the X runlevel, then all this will do is restart the X server. Apparently, not the best way, as you have sadly seen with your cold boots.

Cool
 
Old 12-30-2002, 07:04 AM   #7
then
Member
 
Registered: Oct 2002
Location: FDR India
Distribution: RH9, Knoppix, MEPIS
Posts: 65

Rep: Reputation: 15
Quote:
Originally posted by MasterC
Restarting or killing X with CTRL ALT BACKSPACE is related to which run level you boot into. That's why iceman47 said if you manually start X (with startx) then you can kill it with CTRL ALT BACKSPACE. This is in runlevel 3 on most distros. If you are runlevel 5 in most distros, which usually is the X runlevel, then all this will do is restart the X server. Apparently, not the best way, as you have sadly seen with your cold boots.
/me chagrined for missing the obvious & bangs head against the wall.
thanks MasterC for the explanation.
Quote:
Apparently, not the best way, as you have sadly seen with your cold boots.
Could you please offer any clues for these intermittent crashes or maybe direct me to where I can find some answers. The logs don't indicate any thing about the crash.

These days, I telinit 3 and then shutdown -h now to avoid the crashes.

Regards
theN
 
Old 12-30-2002, 08:16 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
That's a lot of work for a powerdown. Not exactly a fix, but an alternate solution:

You could alias your process. If you telinit 3 then shutdown -h now, you could add something like:
alias halt='telinit 3 && shutdown -h now'

to your .bashrc file. Then you'd just have to have a term window open and, as root, type "halt". Although, I am not sure how great that'd work, it might save you some time.

Your X server crashing from a restart though, I really wouldn't even know where to point you. A search on it seems to bring up a lot of people talking about Nvidia though, so maybe if you run a card with an NV chip, that could be the problem. Maybe a driver update/upgrade would do the trick? Just some suggestions.

Good Luck
 
  


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 Off
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
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 03:32 PM
Kill windows process in Perl mnguyen Programming 2 01-04-2005 10:35 PM
kill a specific session in windows rabeea General 8 12-15-2004 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:17 AM.

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