boot option: runlevel 5 without startx


Forum: DSL Ideas and Suggestions
Topic: boot option: runlevel 5 without startx
started by: mikshaw

Posted by mikshaw on Dec. 15 2005,05:35
DSL has the "dsl 2" boot option that gives you text only as root.  This is useful sometimes, but if a regular user just wants a console it might be handy to have this as an option that does not first require the presence of a backup.
Not too long ago the default was to log in user dsl into text mode in runlevel 5.  Would it be unreasonable to suggest that the user has an option to enter a boot parameter that would give him this same setup automatically?  The "noicons" parameter is used in this way...when xinit runs, it checks for that parameter before deciding whether to launch xtdesk.  The same principle could be applied to .bash_profile...instead of automatically starting x, it could check to see if there is a "textmode" or similar parameter, and then startx if that parameter is not present.

Posted by cbagger01 on Dec. 15 2005,17:45
If you want a more traditional Linux startup behavior, you would pass the init runlevel via a boot parameter and then do the following:

runlevel 1 (IE: dsl 1)
Minimal console mode boot as "root" with no virtual terminals
ALREADY WORKS THIS WAY

Runlevel 2  (IE: dsl 2)
Boot to console text mode as root user + 3 more virtual text terminals
ALREADY WORKS THIS WAY

Runlevel 3 (IE: dsl 3)
Boot to console text mode as user dsl + 3 more virtual text terminals

Runlevel 5 (Is assumed by default, no dsl 5 is needed)
Boot to graphical mode as user dsl
ALREADY WORKS THIS WAY

You can do checks for bootparameter "3" (proc/cmdline) in .bash_profile or you can even check the runlevel itself directly if you prefer.

Posted by mikshaw on Dec. 15 2005,21:10
ohh....I had no idea that runlevel 3 was what I was looking for.  I assumed that runlevel 5 was textmode in debian distros, but that DSL just added "startx".  I'll look into that, thank you.

EDIT:  Sorry, but using runlevel 3 produces exactly the same results as runlevel 2....you get 4 terminals all logged in as root.
My suggestion is to "checkbootparam nox|text|nostartx|whatever" or some such thing from .bash_profile before startx is run.  This would result in the same thing you'd get if you started as normal and then shut down X, except that you wouldn't have to be forced into X to begin with in case your machine can't handle it.
I know this can be done easily enough with backup/restore, but i figure it would be even easier to just add a few bytes to .bash_profile =o)

Posted by cbagger01 on Dec. 17 2005,03:49
Nope.

Runlevel 5 is usually for graphical login

Runlevel 3 is usually for "normal" user login but without automatically starting up the graphical interface.

Posted by mikshaw on Dec. 17 2005,04:25
have you tried it?  Put "3" in your boot parameters and tell me what you get.  The only reason runlevel 5 starts x in DSL is because the startx command is in /home/dsl/.bash_profile
Posted by cbagger01 on Dec. 17 2005,06:46
mikshaw,

I was describing my experiences using other linux distros.

I have not tried runlevel 3 or runlevel 5 with DSL, and I believe that your reports are accurate.

The "nope" in my last post was referring to your runlevel expectations, not to your reports on the behavior of DSL.

Posted by roberts on Dec. 17 2005,07:07
I believe this could be achieved by small tweaks to /.bash_profile changing runlievel 5 test to 3 or greater. Then a runlevel 5 test added  /home/dsl/.bash_profile for the startx.

The purpose is again more support of CLI?

I can't wait for the next review when our CLI support is all the rage.
Headline: DSL is the new DOS!
Honestly, I didn't think there would be a push in this direction.
But then, what do I know.

Posted by cbagger01 on Dec. 17 2005,07:27
roberts,

You can't pin this one on me :D

Mikshaw started the topic

Posted by cbagger01 on Dec. 17 2005,07:33
On a more serious note, I do have a utility script that runs from CD at boot time to perform certain operations on a computer system.

After watching some PCs choke on the xwindows start, I decided to make it a CLI dialog (or in DSL's case whiptail) script and boot up into console mode because even wierdo video cards still understand normal VGA text mode (ie vga=normal) so this insured maximum compatibilty.

This is of course VERY tangentally related to CLI for desktop users but I thought it was still kinda neat to tell about.

Posted by mikshaw on Dec. 17 2005,07:35
Yeah...i understand where the main focus of dsl is, and i can do whatever i want with it as it is.  My main issue was trying to help those people who want to use DSL but cannot run a GUI.  As it is now they have the choice of either failing to get to a useable system or getting a root prompt.  I think it would be very nice if they could have a "dsl" prompt.

cbagger1: do you mind if i peek at your script?

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.