Ya upstart definately has a lot of potential.
For example I probably don't want things like Avahi, Samba, NFS, Exim, or other such network
things running when I am not connected to a network. Also I probably don't want that stuff
running when I am not connected to a safe network. Sometimes some services may hang or foul up
when networks change or network interfaces suddenly wink in and out of existance. On a server
this sort of thing wouldn't happen, but on my laptop this is a daily occurance.
Right now I just have things chmod -x /etc/init.d/xxx that I don't want running on every
network I visit. Then I start them up manually if I need them running. I suppose I could just
have a firewall that I bring up and down, but whatever.
Upstart can solve this problem. With the ability to do very smart dependancy tracking it can
determine what configuration my OS should be in based on whatever criteria and adjust the
services and other stuff accordingly.
I don't think that Upstart is being used for anything like that right now, except maybe
helping people optimize boot times. It's all just emulating the old static init stuff right
now. It's been a while since I looked at it.
Posted Jan 18, 2008 12:47 UTC (Fri) by alankila (subscriber, #47141)
[Link]
Yep. Rewriting this seems like a lot of work. And based on my experience, Ubuntu Hardy hasn't
yet done all of it. Some parts such as getty definitely has been upstart-ified, though.
But there is a thorny problem in the method of launch everything asynchronously from events, I
think.
As an example, I have an USB-attached disk that I want to mount on every bootup. Currently
something tries to do fsck on everything a bit too early. The USB disk is not ready, yet the
dumb fsck tries to access it, barfs on missing device file, tells me to log in as root to
correct it.
This is a bit ridiculous. It's supposed to be a removable device. Conceiveably I could plug it
in any time. And I do want it mounted automatically, too. And I know exactly where I want it
mounted. And most of the time, the device is connected and power is on.
Clearly, the only way to do mounts like this is to have udev detect a new device, then figure
out that it's a disk, and check fstab and find that user wants it mounted. So *udev* has to
launch fsck and do that mount, if fsck says it's safe to mount. And that sucks because from
asynchronous daemon you have hard time communicating to user that something is wrong with the
connected device, and he needs to take action.
Assume for instance that there is a disk error during boot time. There's no X yet, no notify
area in console, the system is only half ready. What on Earth can you do? Skipping the drive
might be good idea, but what if /usr is on it? It's conceiveably quite easy to handle failures
of non-critical disk mounts from, say, GNOME (just pop up a messagebox in notify area about
error), but at boot time you are SOL.
So what are the solutions? Start X before starting anything else, maybe? Implement a notify
area for Linux console? Accept that stuff mounted during bootup from fstab is fundamentally
different from anything done later on, and thus fragment the user experience? All these
solutions that come to mind seem to suck for one reason or other. Of all of them, I'd prefer
to drop the stupid splash screen and launch X, actually. Imagine that.
Reordering the boot for fun and profit
Posted Jan 18, 2008 14:19 UTC (Fri) by michaeljt (subscriber, #39183)
[Link]
What about letting a console application, i.e. the bootsplash, register for notifications if
it wishes to (this should be possible now)? And if no application is currently registered for
notifications, simply write to a log and take the most conservative decision possible? One of
the things which I slightly dislike about all this new udev/hal/etc infrastructure is that it
is all so graphically oriented, although there is no intrinsic reason for it. It would be so
nice for X11 and the command line to be equally privileged citizens (in fact, more often than
not the command line is still the privileged one).
Reordering the boot for fun and profit
Posted Jan 18, 2008 14:58 UTC (Fri) by alankila (subscriber, #47141)
[Link]
Possible. You are right in that the splash probably already could deliver notifications. On
the other hand, why not just start X instead?
Reordering the boot for fun and profit
Posted Jan 18, 2008 19:59 UTC (Fri) by nix (subscriber, #2304)
[Link]
udev, graphically oriented? WTF? It's purely-textual, doesn't link with X,
and as far as I know there are no X tools that talk to it. It *is* quite
hotplug-oriented, but that's sort of its raison d'etre...
It's true that hal/dbus is sort of graphically oriented, in that there is
a per-X-session message bus; but more than that hal itself is distribution
oriented, with the maintainers brushing off or ignoring outright segfaults
if you're not running a binary packaged by a major distro. Given that hal
runs as root, this is more than slightly disturbing.
Reordering the boot for fun and profit
Posted Jan 19, 2008 13:29 UTC (Sat) by michaeljt (subscriber, #39183)
[Link]
Point taken regarding udev. Regarding the rest though, I would certainly appreciate say my
CDs being automounted when X is not currently running.
Reordering the boot for fun and profit
Posted Jan 24, 2008 10:54 UTC (Thu) by nix (subscriber, #2304)
[Link]
I do that with udev :) (ejecting on unmount is probably doable too, but I haven't looked at
it. umounting on eject I haven't looked at, as without revoke() it's never going to work
reliably.)