LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Does Ctl-Alt-F1 kill X, or just put in background? (https://www.linuxquestions.org/questions/linux-general-1/does-ctl-alt-f1-kill-x-or-just-put-in-background-159667/)

TreeDragon60 03-18-2004 11:49 PM

Does Ctl-Alt-F1 kill X, or just put in background?
 
First off, thanks to all the people that are smarter than me that post here - I've been using Fedora for about a month now, and have a game server, web server, file server, and all the basic apps running smoothly - thanks mostly to this forum and it's great members.

Now that the mushy stuff is out of the way...

I have looked but can't find a basic answer to this question...if I am in X Gui, when I hit ctl-alt-F1, does it kill the X gui, or is it still running in the background (and still using resources)?.

The reason I ask...I only have a 933mhz machine with 512 RAM, and want to use all the resources for running the above servers, and am learning how to do stuff from the shell so I don't use any of my computer's resources with the GUI.

So can I do ctl-alt-F1 to kill the gui, or is it better to change to init 3 and then back to init 5 when I want to work in the gui? Also, does it make a difference if I kill the gui as opposed to rebooting in init 3 when it comes to recovering available resources? (From all I have learned about how Linux uses resources I think the answer to this is no, but....not sure). Or is there an easier way to do it that I don't know about yet?

Thanks again for all the great help here!!!

flv7a 03-19-2004 12:09 AM

Ctrl-Alt-F1 merely switches to one of the other ttys.
By default Ctrl-Alt-(F1-F6) are the text based ttys, with X running on the 7th (Ctrl-Alt-F7)

If you are concerned with resources, it is far better to switch to runlevel 3 vs. simply killing X as there are other processes that start in support of the X environment.

Perhaps ideally you might want to change your default boot runlevel from 5 to 3:
Look for this line in /etc/inittab:
id:5:initdefault:
and simply change the 5 to a 3.

After doing so your machine will simply boot to a text based login. After you're logged in you can start X simply by typing 'startx', and when you log out of Gnome/KDE you'll be back to the text tty.

Hope this helps.

TreeDragon60 03-19-2004 01:15 AM

Thanks for the info...that does help...

I thought that was how it worked, but wanted to make sure...thanks again!!!

JZL240I-U 03-19-2004 08:07 AM

You stop X with <Ctrl>+<Alt>+<Backspace>. Try that and list the processes still alive with ps -a (man ps ;)) or top. Then look at your free resources. (I have 700 MHz and 640 MB and use frequently three users with their separate GUIs with no problems).

Startx has more possibilities:
When you set initdefault 3 do e.g.
login as root
startx
(that gives root his default GUI under <Ctrl>+<Alt>+<F7>)

<Ctrl>+<Alt>+<F2>
login as user #1
startx -- :2
[with the blanks exactly as shown above]
(that gives user #1 his default GUI under <Ctrl>+<Alt>+<F8>)

<Ctrl>+<Alt>+<F3>
login as user #2
startx -- :3
[with the blanks exactly as shown above]
(that gives user #2 his default GUI under <Ctrl>+<Alt>+<F9>)

You can also change the GUI with the startx-command with something like

startx -gnomestart :3

but here I am not sure of the syntax.

An Ampersand at the end of the startx commands like
startx -- :3 &
will spawn the GUI as background job and you can use the text-terminal as usual without it being blocked by the startx command.

Experiment and enjoy :D.

TreeDragon60 03-19-2004 10:17 AM

JZL - awesome info - thanks.

I read a bunch of stuff on this and didn't really grasp it until now - thanks for the clear explanation - it all works like a charm.

Geez I love Linux...

DavidPhillips 03-19-2004 11:37 PM

ctrl-alt-bksp actually crashes the X server, you should only do this as a last resort as opposed to using sys rq or pulling the plug out of the wall socket. Log off if you are ending your X session.

JZL240I-U 03-22-2004 08:15 AM

Quote:

Originally posted by DavidPhillips
ctrl-alt-bksp actually crashes the X server...
Huh? Is that different to
Code:

kill -9 X(*)
(*): X standing for whatever name the X-session really uses? On the third hand ;) what does an
Code:

init 3
really do?? (normal stop process "X" perhaps :confused: ).

DavidPhillips 03-22-2004 09:21 PM

kill -9 would be about the same thing as ctrl-alt-bksp

init 3

That's a different story, it depends on your init scripts, how you started X in the first place, and what the runlevel is when you run startx. Also it would matter if you are using a login manager for X and are in runlevel 5.

It could very well do nothing at all.


People who get out of X would be better off starting up in runlevel three and using startx.

Just log off.

JZL240I-U 03-24-2004 01:44 AM

I see. Thank you. :)

DavidPhillips 03-29-2004 08:18 PM

I just saw this, which explains some more on using kill -9


Don't use kill -9.

It doesn't give the process a chance to cleanly:

1) shut down socket connections

2) clean up temp files

3) inform its children that it is going away

4) reset its terminal characteristics

and so on and so on and so on.

Generally, send 15, and wait a second or two, and if that doesn't
work, send 2, and if that doesn't work, send 1. If that doesn't,
REMOVE THE BINARY because the program is badly behaved!

Don't use kill -9. Don't bring out the combine harvester just to tidy
up the flower pot.

:)


I don't know who wrote it, I found it here.. (with other stuff I'm guilty of)

http://www.sektorn.mooo.com/era/unix/award.html

JZL240I-U 03-31-2004 01:08 AM

Thanks again, for longer explanation and link :).

DavidPhillips 03-31-2004 01:21 AM

I think I should have won the useless use of cat award a few times. For some unknown reason it seems like more fun to use `cat filename| less` than `less filename`. If you don't use cat you would not need a pipe.

Pipes rule. :)

JZL240I-U 03-31-2004 01:27 AM

Isn't it late night now in Alabama? What are you doing with your computer at this time (except typing atrocities with cats ;))?

:D

DavidPhillips 03-31-2004 01:38 AM

Just checking the emails. I can't get past the stupid elephants on LOTR.

Driving me crazy.

JZL240I-U 03-31-2004 01:41 AM

Quote:

Originally posted by DavidPhillips
LOTR
Lord of the Rings?

:D


All times are GMT -5. The time now is 05:37 AM.