FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-18-2010, 05:09 AM
Adam
 
Default Are runlevels 3 4 5 the same?

I want to choose console or X from grub, so i'm thinking i'll do
something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
grub boot line, to make runlevel 4 a console runlevel. Is that the right
way to do it?
 
Old 04-18-2010, 05:21 AM
Dale
 
Default Are runlevels 3 4 5 the same?

Adam wrote:

I want to choose console or X from grub, so i'm thinking i'll do
something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
grub boot line, to make runlevel 4 a console runlevel. Is that the right
way to do it?




Gentoo doesn't use those runlevels. You need to read this:

man rc-update

Gentoo comes with the following runlevels:

root@smoker ~ # ls /etc/runlevels/
total 5
drwxr-xr-x 6 root root 152 Jun 11 2008 .
drwxr-xr-x 81 root root 4832 Apr 18 00:16 ..
drwxr-xr-x 2 root root 368 Jun 11 2008 boot
drwxr-xr-x 2 root root 512 Apr 9 20:05 default
drwxr-xr-x 2 root root 72 Jun 11 2008 nonetwork
root@smoker ~ #

It generally boots to default. You can change that on the kernel boot
line but with one of the above instead of a 4 as you posted.


Post back if you get stumped along the way.

Dale

:-) :-)
 
Old 04-18-2010, 05:41 AM
Adam
 
Default Are runlevels 3 4 5 the same?

On 04/18/10 15:21, Dale wrote:
> Adam wrote:
>> I want to choose console or X from grub, so i'm thinking i'll do
>> something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
>> grub boot line, to make runlevel 4 a console runlevel. Is that the right
>> way to do it?
>>
>>
>
> Gentoo doesn't use those runlevels. You need to read this:
>
> man rc-update
>
> Gentoo comes with the following runlevels:
>
> root@smoker ~ # ls /etc/runlevels/
> total 5
> drwxr-xr-x 6 root root 152 Jun 11 2008 .
> drwxr-xr-x 81 root root 4832 Apr 18 00:16 ..
> drwxr-xr-x 2 root root 368 Jun 11 2008 boot
> drwxr-xr-x 2 root root 512 Apr 9 20:05 default
> drwxr-xr-x 2 root root 72 Jun 11 2008 nonetwork
> root@smoker ~ #
>
> It generally boots to default. You can change that on the kernel boot
> line but with one of the above instead of a 4 as you posted.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4

So gentoo does use the numerical runlevels (because that's what init
uses) as well as the gentoo runlevels you've shown. It looks like it
just maps the numbers to the names in inittab;

l0:0:wait:/sbin/rc shutdown
l0s:0:wait:/sbin/halt -dhp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dk

so, i guess this means i should point l4 to a custom runlevel in
/etc/runlevels that is the same as default with the exception that xdm
is removed... I'm assuming the linux kernel wont understand the gentoo
named runlevels, and therefore using those names in grub wouldnt work.
 
Old 04-18-2010, 05:55 AM
Dale
 
Default Are runlevels 3 4 5 the same?

Adam wrote:

On 04/18/10 15:21, Dale wrote:


Adam wrote:


I want to choose console or X from grub, so i'm thinking i'll do
something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
grub boot line, to make runlevel 4 a console runlevel. Is that the right
way to do it?




Gentoo doesn't use those runlevels. You need to read this:

man rc-update

Gentoo comes with the following runlevels:

root@smoker ~ # ls /etc/runlevels/
total 5
drwxr-xr-x 6 root root 152 Jun 11 2008 .
drwxr-xr-x 81 root root 4832 Apr 18 00:16 ..
drwxr-xr-x 2 root root 368 Jun 11 2008 boot
drwxr-xr-x 2 root root 512 Apr 9 20:05 default
drwxr-xr-x 2 root root 72 Jun 11 2008 nonetwork
root@smoker ~ #

It generally boots to default. You can change that on the kernel boot
line but with one of the above instead of a 4 as you posted.


http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4

So gentoo does use the numerical runlevels (because that's what init
uses) as well as the gentoo runlevels you've shown. It looks like it
just maps the numbers to the names in inittab;

l0:0:wait:/sbin/rc shutdown
l0s:0:wait:/sbin/halt -dhp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dk

so, i guess this means i should point l4 to a custom runlevel in
/etc/runlevels that is the same as default with the exception that xdm
is removed... I'm assuming the linux kernel wont understand the gentoo
named runlevels, and therefore using those names in grub wouldnt work.




If you want to boot to the single runlevel, just add softlevel=single to
the end of the boot line in grub. You can do this in the config or edit
the boot line when grub comes up and it should work fine. I have never
used the number runlevels. It may work but I have never done it that
way so I can't really say one way or the other.


You can also create custom runlevels if you need them. I created one a
while back to play with and I just added the directory and added the
services I wanted in there. That should work fine. There may be other
ways to create them as well.


Also, you can use eselect to manage this as well. The module is called
rc. I don't use it but that is the up and coming way to do it.


Dale

:-) :-)
 
Old 04-18-2010, 08:09 AM
Mick
 
Default Are runlevels 3 4 5 the same?

On Sunday 18 April 2010 06:09:38 Adam wrote:
> I want to choose console or X from grub, so i'm thinking i'll do
> something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
> grub boot line, to make runlevel 4 a console runlevel. Is that the right
> way to do it?

You could create a new default runlevel for this purpose, or you could try
passing the 'nox' option to the kernel, at boot time. There was a bug filed
some time ago because an xinit update broke this option, but I believe it has
been fixed now. Try it and see if this is what you need.

--
Regards,
Mick
 
Old 04-18-2010, 10:31 AM
Neil Bothwick
 
Default Are runlevels 3 4 5 the same?

On Sun, 18 Apr 2010 09:09:42 +0100, Mick wrote:

> > I want to choose console or X from grub, so i'm thinking i'll do
> > something like 'rc-update delete xdm 4' and then pass softlevel=4 to
> > my grub boot line, to make runlevel 4 a console runlevel. Is that the
> > right way to do it?
>
> You could create a new default runlevel for this purpose, or you could
> try passing the 'nox' option to the kernel, at boot time. There was a
> bug filed some time ago because an xinit update broke this option, but
> I believe it has been fixed now. Try it and see if this is what you
> need.

The correct option is gentoo=nox. nox on its own sometimes works, but
it's not the proper way to do it.


--
Neil Bothwick

SITCOM: Single Income, Two Children, Oppressive Mortgage
 
Old 04-18-2010, 03:04 PM
Peter Humphrey
 
Default Are runlevels 3 4 5 the same?

On Sunday 18 April 2010 06:41:47 Adam wrote:

> i guess this means i should point l4 to a custom runlevel in
> /etc/runlevels that is the same as default with the exception that
> xdm is removed...

That's what I do. I have /etc/runlevels/no-x/ which contains all the
services I want started if I boot a CLI-only system. It's sometimes
handy to have all the virtual consoles available, so single mode doesn't
help here.

> I'm assuming the linux kernel wont understand the gentoo named
> runlevels, and therefore using those names in grub wouldnt work.

Grub runs before the kernel; in fact grub finds the kernel on the disk
from the details you specify in /boot/grub/grub.conf.

Here's a snippet from my grub.conf:

title=Gentoo Linux 2.6.33-r1
root (hd0,0)
kernel /boot/kernel-x86_64-2.6.33-gentoo-r1 root=/dev/md3
vga=0x31A video=vesafb:mtrr:2,ypan fbcon=scrollback:128k splash=silent

title=Gentoo Linux 2.6.33-r1, no X
root (hd0,0)
kernel /boot/kernel-x86_64-2.6.33-gentoo-r1 root=/dev/md3
vga=0x317 video=vesafb:mtrr:2,ypan fbcon=scrollback:128k splash=silent
softlevel=no-x

Then I just scroll to the version I want and hit Enter.

--
Rgds
Peter.
 
Old 04-18-2010, 05:21 PM
Alan McKinnon
 
Default Are runlevels 3 4 5 the same?

On Sunday 18 April 2010 07:21:56 Dale wrote:
> Adam wrote:
> > I want to choose console or X from grub, so i'm thinking i'll do
> > something like 'rc-update delete xdm 4' and then pass softlevel=4 to my
> > grub boot line, to make runlevel 4 a console runlevel. Is that the right
> > way to do it?
>
> Gentoo doesn't use those runlevels. You need to read this:

Well said Dale.

Numbered runlevels a-la ancient init are a stupid idea, were always a stupid
idea and always will be a stupid idea.

I have never seen anyone actually use them!

Here's what people do use:

- a boot config for single user/maintenance (fix stuff with this)
- what you use everyday. Possibly also
- another config for some rare circumstance (like occasionally not running X
for some reason. But most folk just stop xdm to do that)

>
> man rc-update
>
> Gentoo comes with the following runlevels:
>
> root@smoker ~ # ls /etc/runlevels/
> total 5
> drwxr-xr-x 6 root root 152 Jun 11 2008 .
> drwxr-xr-x 81 root root 4832 Apr 18 00:16 ..
> drwxr-xr-x 2 root root 368 Jun 11 2008 boot
> drwxr-xr-x 2 root root 512 Apr 9 20:05 default
> drwxr-xr-x 2 root root 72 Jun 11 2008 nonetwork
> root@smoker ~ #
>
> It generally boots to default. You can change that on the kernel boot
> line but with one of the above instead of a 4 as you posted.
>
> Post back if you get stumped along the way.
>
> Dale
>
> :-) :-)

--
alan dot mckinnon at gmail dot com
 
Old 04-18-2010, 05:50 PM
Neil Bothwick
 
Default Are runlevels 3 4 5 the same?

On Sun, 18 Apr 2010 16:04:37 +0100, Peter Humphrey wrote:

> That's what I do. I have /etc/runlevels/no-x/ which contains all the
> services I want started if I boot a CLI-only system. It's sometimes
> handy to have all the virtual consoles available, so single mode
> doesn't help here.

That's whay I used to do until I found the gentoo=nox option, it saves
maintaining an extra runlevel.


--
Neil Bothwick

When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
 
Old 04-18-2010, 10:58 PM
Peter Humphrey
 
Default Are runlevels 3 4 5 the same?

On Sunday 18 April 2010 18:50:01 Neil Bothwick wrote:
> On Sun, 18 Apr 2010 16:04:37 +0100, Peter Humphrey wrote:
> > That's what I do. I have /etc/runlevels/no-x/ which contains all
> > the services I want started if I boot a CLI-only system. It's
> > sometimes handy to have all the virtual consoles available, so
> > single mode doesn't help here.
>
> That's whay I used to do until I found the gentoo=nox option, it
> saves maintaining an extra runlevel.

But X isn't the only thing I don't run when not running X, if you see
what I mean. Only about 3 other things differ at the moment, but I leave
the possibilities open.

And I don't have to type anything at the grub command prompt.

And maintaining the other run level is not arduous anyway, as changes
occur only when I install or remove a system service. Rarely, in other
words.

To each his own, of course, as ever.

--
Rgds
Peter.
 

Thread Tools




All times are GMT. The time now is 11:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org