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

Re: booting Debian-6 in run level 3



On 13/01/12 15:21, Darac Marjal wrote:
On Fri, Jan 13, 2012 at 03:28:24PM +0200, Andrei Popescu wrote:
On Vi, 13 ian 12, 12:13:52, Darac Marjal wrote:
On Fri, Jan 13, 2012 at 04:21:11PM +0530, Bijoy Lobo wrote:
    Hi Everyone,

    I have read online that Debian Squeeze has no differentiation in runlevels
    from 2-5, although I would like to boot my debian box in CLI mode. Any way
    I can achieve this?

Out of the box, this is true, but it is considered acceptable for system
maintainers to alter the runlevels.

First of all, you need to determine which Display Manager you're using
to start graphical mode. Usually this will be gdm or gdm3, but might be
kdm, xdm or something else. Find the init-script for that service
(/etc/init.d/gdm3, for example). At the top of the script you will find
a comment:

  # Default-Start:     2 3 4 5

Change this to read:

  # Default-Start:     2 4 5

Next up, find the link to that script in /etc/rc3.d (it will be SXXgdm3
for example, were XX is a number). Delete that symlink.

This will work, but it is not the recommended way. As far as I know,
under Sys V, the canonical method to disable a service in a specific
runlevel is to rename the S link to a K link (plus some juggling with
sequence numbers, which is obsolete with insserv). There is no need to
edit init scripts.

I agree that switching S to K is better than simply removing the link
(it allows you to switch to that runlevel from any other, for example),
but I don't agree that there's no need to edit the init script. Next
time insserv is run, won't the symlink just get switched back? The
better option is to move the "3" from "Default-Start" to "Default-Stop"
and let insserv re-render the rc?.d directories appropriately.

Further to this, I'd prefer not to touch the scripts in /etc/init.d at all.

Instead I'd copy just the header part of the script to a file of the same name in /etc/insserv/overrides and run the insserv update command (I can't remember off the top of my head which options are required).

This means that updates to the start-up/shut-down scripts will still be applied, but the run levels will be controlled by the override scripts.

--
Dom


Reply to: