[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: stop xwindows from loading at boot



debian installs use a default runlevel of 2 at boot.

in /etc/inittab, there is a line which you can change to boot into a different runlevel.
-----------------------------------------------
# cat /etc/inittab
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:
....
-----------------------------------------------

basics of runlevels:  0, 1 and 6 are reserved.  (halt, single user and reboot respectively)
other common runlevels are 2,3,4 and 5.
for more info on runlevels:
#man init
you can change the runlevel to which the computer boots into by changing the number in the line
id:2:initdefault:
 *warning* do not change this number to 0 or 6.  that will make your machine either shutdown or reboot after booting.

so, you want to setup a runlevel that doesn't load any display manager.  (gdm, kdm, xdm...)  so, you'll want to remove
the approriate scripts from the /etc/rc2.d directory.  Now, as someone else said (see other peoples emails below), you
can simply delete the scripts, or you can use the update-rc.d command ("#man update-rc.d" for more info).  It's not that
big of a deal if you do it manually, but it's always better to learn how to do it using the tools that are designed to
manage them.

now, you may still want to use a gui/display manager, just not right off boot.  and if such is the case, runlevel 3 is
usually also setup by default to run the gui.  So at any point, you can enter runlevel 3 by doing:
#init 3
and the gui/display manager will load

if you do wish to switch back and forth easily between gui and consoles, there are 2 ways you can approach this.  Either
using ctrl-alt-F1 through ctrl-alt-F7 (7 is gui, 1 through 6 are text) or by putting kill scripts into runlevel 2 for
the display manager. (you can do this using update-rc.d) at which point you can switch back and forth between runlevel 2
and 3 by simply typing "init" and then "2" or "3".  if you have the kill scripts, the gui/display manager would be shut
down when you enter runlevel 2.

this may look complicated, but it's quite simple.  just be careful on the syntax for update-rc.d
-doug



----- Original Message -----
From: "Pollywog" <linux-debian@shadypond.com>
To: <debian-user@lists.debian.org>
Sent: Monday, March 21, 2005 6:25 PM
Subject: Re: stop xwindows from loading at boot


On Tuesday 22 March 2005 02:15 am, Roberto C. Sanchez wrote:
> Russ Menapace wrote:
> > So how DO you stop X after it boots, anyhow…or prevent it from booting?
> > Ctrl-alt-backspace shuts it down, but it reloads instantly.  I have been
> > trying to figure this out for several days, and wonder if maybe I should
> > just switch distros.
>
> Seems like a silly reason to switch distros.  To stop X, just run:
> /etc/init.d/[gxk]dm stop
>
> To stop it permanently, remove /etc/rc2.d/S99[gxk]dm
>
> Since Debian defaults to run level 2, you will then boot to a text
> console.  If you want to boot to a graphical log in prompt, then tell
> the system to use runlevel 3, 4, or 5 at boot.
>
> As a final alternative, you can just remove the [gxk]dm package(s).
>
> -Roberto

kdm and gdm also have an option to login to a console, don't they?
If one wants to completely disable the session manager, one could
edit /etc/init.d/[kxg]dm   and put  'exit 0'  (without the quotes) on the
line that follows the #!/bin/sh  line.  That way one would not have to remove
the package.

When I want to login to a shell prompt, I just hold down ctrl-alt and touch F1
or F2, etc to get a console.


8)

--
sp@mtr@p: croak@shadypond.com




Reply to: