Boot Process
Ubuntu has abandoned inittab in favour of their homegrown upstart, not in itself a bad thing, but as shipped it is not configured in such a way that some very useful behaviour of inittab is replicated.
The configuration files for upstart are in /etc/events.d. The most important of these is rc-default which determines what runlevel is entered at boot-time. Here's the version that ships with Ubuntu/gutsy with line numbers added for reference.
01|# rc - runlevel compatibility 02|# 03|# This task guesses what the "default runlevel" should be and starts the 04|# appropriate script. 05| 06|start on stopped rcS 07| 08|script 09| runlevel --reboot || true 10| 11| if grep -q -w -- "-s\|single\|S" /proc/cmdline; then 12| telinit S 13| elif [ -r /etc/inittab ]; then 14| RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" \
--| /etc/inittab || true)" 15| if [ -n "$RL" ]; then 16| telinit $RL 17| else 18| telinit 2 19| fi 20| else 21| telinit 2 22| fi 23|end script
Now, the content of this file means that if single-mode is specified on the kernel command line with -s, single, or S, then the system goes into single-user mode [11-12].
Otherwise, if a runlevel is specified in the usual way in /etc/inittab, then that runlevel is used [13-16]. only the line that sets the default runlevel is important, the rest of the inittab is ignored.
If neither of the above work, the runlevel is 2. [17-22]
Line [09] just records the boot time in utmp, it does not affect what runlevel is chosen.
In summary, the choices are (in priority order):
- Single user mode, if specified on the kernel command-line
- The runlevel specified in /etc/inittab, if any
- Runlevel 2
What this means is that there is no way whatsoever of choosing amongst alternative runlevels at boot-time. Even by editing the kernel command-line at the boot prompt, your choices are single-user mode or whatever has been “hard-wired” into the configuration files.
Furthermore, runlevels 2 to 5 are identical, and all of the tools that ship with Ubuntu by default, change all of them.
Why It's Bad
Well the “graphics mode or bust” model is broken. I get to see the break because I use my desktop in a number of different ways:
- As a regular desktop (GUI needed)
- For scientific computing (GUI not wanted)
- To ssh into when I'm away from home (GUI not needed).
In addition, I use proprietary drivers for my graphics card. Every time I update the drivers, it's advised that I remove the previous version, and I have to recompile and install the kernel module interface. It's much cleaner to do all of this in text-only mode, and very convenient for the network to be operational while I'm doing it so I can fetch any new packages that I might need. It's also a very good idea to be able to fall back to text-mode with networking if the new driver doesn't work.
In short, I want to be able to choose a text-only runlevel at boot-time that is not the crippled single-user mode, and it takes far too much effort to get that working under Ubuntu.
What About telinit
There are far too many flies in that ointment!
In 11 years of using Linux, I have never known telinit to switch runlevels cleanly and without something whacky happening. The notion that you can seamlessly switch runlevels on-the-fly by typing telinit X is only proposed by people who've never actually done it.
Secondly, many graphics cards have problems switching from graphics-mode to text-mode.
Thirdly, when booting for the first time with a new graphics driver, you don't want to be inexorably committed to graphics mode.
Because your pretty high in the rankings when searching about problems in upstart, i thought I'd clear up a few things
1) You can now specify the default runlevel in the kerenel parameters, /etc/inittab or /etc/init/rc-sysinit.conf
2) You can change gui runlevels by editing /etc/init/*dm.conf to have the line start on(...bla... and runlevel [45]) stop on runlevel [01236]
I hope that helps people that stumble across this post, regarding the post:
1 was fixed because instead of moaning about it, somebody fixed it and submitted that fix which is now in 9.10 (possibly earlier)
Having all the runlevels the same was something inherited from debian and it doesn't seem that bad, if you want to separate runlevels then you define them.
As for "graphics mode or bust", if you have a problem you drop to recovery mode and get a nice menu to fix it, I don't see your problem but hey some people just like to complain right.
It really isn't that hard, but it would be nice if there was a gui to edit upstart configuration.
Ok I'm looking at this again and I think this is a problem with xinit and not upstart. So I think I'll try another post more accurately describing the problem.
mutuelle santé