Discussion:
[ubuntu-us-mi] Booting Ubuntu
Robert Citek
2008-06-06 17:30:12 UTC
Permalink
Can anyone recommend where I can find more information on how Ubuntu boots?

Ubuntu seems to do things a bit differently from other distros. 'man
boot' and 'man inittab' don't seem to accuratly describe what is
actually happening when Ubuntu boots.

Any pointers appreciated.

Regards,
- Robert
Flavio daCosta
2008-06-06 17:33:29 UTC
Permalink
http://upstart.ubuntu.com/

http://en.wikipedia.org/wiki/Upstart
Post by Robert Citek
Can anyone recommend where I can find more information on how Ubuntu boots?
Ubuntu seems to do things a bit differently from other distros. 'man
boot' and 'man inittab' don't seem to accuratly describe what is
actually happening when Ubuntu boots.
Any pointers appreciated.
Regards,
- Robert
Robert Citek
2008-06-06 17:54:19 UTC
Permalink
Thanks, Flavio.
Flavio daCosta
2008-06-06 18:58:49 UTC
Permalink
On 06/06/2008 01:54 PM, Robert Citek wrote:
...
Would it be fair then to say the first three parts in 'man boot' are
mostly unchanged?
yes

...
I'm guessing then that the third part needs to be modified to say
upstart instead of /sbin/init. If so, where is upstart?
Wherever you want it, but in Ubuntu /sbin/init is upstart.


Spend some time to go through the site, there are some decent docs on
there. (A while back some of the examples didn't work as advertised but
I think it's stabilized now.) Also some nice explanations/examples in
the authors blog: http://www.netsplit.com/
Robert Citek
2008-06-07 05:59:06 UTC
Permalink
Post by Flavio daCosta
I'm guessing then that the third part needs to be modified to say
upstart instead of /sbin/init. If so, where is upstart?
Wherever you want it, but in Ubuntu /sbin/init is upstart.
Ah, I see. There is no program called 'upstart'. Instead, /sbin/init
start the upstart way instead of the sysV way.
Post by Flavio daCosta
Spend some time to go through the site, there are some decent docs on
there. (A while back some of the examples didn't work as advertised but
I think it's stabilized now.) Also some nice explanations/examples in
the authors blog: http://www.netsplit.com/
So the first three section of 'man boot' still hold. What's not clear
is what happens next. Here's an excerpt from 'man boot':

<quote>
init and inittab
When init starts it reads /etc/inittab for further instructions.
This file defines what should be run in different run-levels.

This gives the system administrator an easy management scheme,
where each run-level is associated with a set of services (e.g: S is
single-user, on 2 most network services start, etc.). The
administrator may change the current run-level via init(8) and query
the current run-level via runlevel(8).

However, since it is not convenient to manage individual
services by editing this file, inittab only bootstraps a set of
scripts that actuallystart/stop the individual services.
</quote>

That section of the man page seems to differ from what actually
happens using upstart. For example, there is no more /etc/inittab.
Yet, there still seems remain something of the concept of runlevels.
That is, I can type the command 'runlevel' and get an answer. I can
also change runlevels with 'telinit', e.g. 'telinit 6' to reboot. And
I can still modify how scripts start and stop by changing the symlinks
in /etc/rc?.d/ directories.

What I have not been able to do is temporarily change my runlevel at
startup. That is, in the past I could boot into runlevel 5 by simply
adding a 5 to the end of a grub kernel line. That doesn't work. For
example,

$ cat /proc/cmdline
root=UUID=538f72a2-fbc0-454f-a058-32d1a0cae8b3 ro 5

$ runlevel
N 2

As the runlevel command shows, Ubuntu still booted into runlevel 2.

So, how does one boot into runlevel 5 or is the concept of runlevels
somehow altered or deprecated?

Regards,
- Robert
Robert Citek
2008-06-07 14:47:53 UTC
Permalink
Post by Robert Citek
So, how does one boot into runlevel 5 or is the concept of runlevels
somehow altered or deprecated?
I'm still not clear on how to boot into a different runlevel.
Specifically, what would be nice is to not only boot into different
runlevels but also boot into "emergency mode" with the -b option.
Being able to control the way Ubuntu boots greatly helps debugging
many types of system bugs.

But from a little digging, yes, the concept of runlevels is being
deprecated. From 'man runlevel':

<quote>
NOTES
This tool is provided for compatibility with the traditional
System V init(8). Upstart has no notion of runlevels itself, this and
the telinit(8) tool are provided to emulate their behaviour.
<quote>

BTW, to change to default runlevel from 2 to 5 at boot time, change
'telinit 2' to 'telinit 5' in four places: twice in
/etc/event.d/rc-default and twice in /etc/event.d/rcS-sulogin.

Regards,
- Robert

Loading...