PDA

View Full Version : Move over 'sysvinit', 'upstart' is the new kid in town



TheFridge
September 2nd, 2006, 10:00 PM
http://fridge.ubuntu.com/files/upstart120.pngOn a Unix system, ‘init’ is in control. She is your mother, your grandmother and your great-grandmother. Only once in a generation is a new one born; and seeing that happen is history in the making.
The GNU/Linux combination at the heart of Kubuntu and Ubuntu has a design heritage stretching back nearly 30 years. Past when SCO Group starting suing IBM (http://en.wikipedia.org/wiki/SCO_v._IBM_Linux_lawsuit), even further back, past even when SCO had a purpose in life. The Unix (http://en.wikipedia.org/wiki/Unix) design ideas have withstood the test of time, watching the universe expand as time ticks slowly by. We’ll follow that course…
Back through history

Going back in time, we see Ian Murdock start Debian (http://groups.google.com/group/comp.os.linux.development/msg/a32d4e2ef3bcdcc6); beyond that Linux Torvalds’ (http://groups.google.com/group/comp.os.minix/browse_thread/thread/76536d1fb451ac60/b813d52cbc5a044b?lnk=gst&q=&rnum=32#b813d52cbc5a044b) introduction of Linux, we briefly see the 1984 Apple advert (http://en.wikipedia.org/wiki/1984_%28television_commercial%29) flashing on a screen in the background. Accelerating as we continue, past Richard Stallman’s announcement of GNU (http://groups.google.com/group/net.unix-wizards/msg/4dadd63a976019d7), finally slowing down, to an era of funky hairdos (http://en.wikipedia.org/wiki/Hippie), prohibited substances and flower-covered VW camper vans (http://en.wikipedia.org/wiki/Volkswagen_Type_2). Welcome to the 1960’s.
Over those years, vast swathes of research money has been put into finding out whether the chicken or the egg came first. Unix has always had it simple, init came first. Once the kernel (at the heart of Ubuntu) has been loaded, control is transferred to the first program. This process is given the first process number on the system, 1 (one) in recognition.
Because of the fundamental involvement with initialisation, this first program is normally nick-named init and its job is to start other programs—the ones that make your computer do interesting things and help you to perform work… or play Tuxracer (http://tuxracer.sourceforge.net/Tuxracer).
Most Linux-based distributions have standardised on a variation of known as sysvinit after the System V (http://en.wikipedia.org/wiki/UNIX_System_V) (“system five”) variation of Unix developed by AT&T for release in the early 1980’s. sysvinit uses a series of directories named rc?.d where the question mark (?) is a number representing startup, running or shutdown—Red Hat has a good explanation on their site (http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/s1-boot-init-shutdown-sysv.html).
The downside is that modern machines are much more magical, they change their configuration in use&dmash;when USB drives are plugged in, or removed, as network connections come and go. Consequently there are alot of waits during the boot sequence to check if things have happened, checking if there is a network connection, or to be able to update the time.
http://fridge.ubuntu.com/files/upstart-talk-1-small.jpg (http://fridge.ubuntu.com/files/upstart-talk-1.jpg)
Scott James Remnant preaches to enthralled Ubunteros

Upstart takes shape

What Ubuntu needed is something dynamic, something that reacts, changing as the system does. The result of that is upstart, a new init system designed to based on events occuring. Many people have tried to solve this problem, one of the most famous being ‘InitNG’, but as upstart primary author Scott James Remant tells us on his highly detailed blog post (http://www.netsplit.com/blog/work/canonical/upstart.html):

the difference in model can be summed up as “initng starts with a list of goals and works out how to get there, upstart starts with nothing and finds out where it gets to.”
That is say, unless a message comes in to say that the network is up, then DHCP will not attempt to automatically get an IP address. In addition, unless a messages comes in saying that there is a successful connection to the outside world then network programs like the Apache web-server will not need to be started.
The primary drive behide upstart is make the system simpler and more reliable; speed is not the intention, merely a possible, and unexpected, side-effect in the long-run. Some people have already noticed a gain in shutdown speed thanks to the Teardown (https://wiki.ubuntu.com/Teardown) specification reducing the amount work down on shutdown. Powering-off will now only stop those programs, like databases, that matter require a careful shutdown to ensure data consistency.
Testing out upstart

The excellent news over on the ubuntu-devel list is that upstart is ready for some serious testing (https://lists.ubuntu.com/archives/ubuntu-devel/2006-September/020368.html). One of the secrets of replacing core software is backwards compatibility, so you can be safe in the knowldge that upstart doesn’t need all the other programs re-writing; it simply drops in using the existing startup scripts.
Scott James (aka keybuk (https://launchpad.net/people/keybuk) online) is keen for testers already working with the edgy development release, but points out that you’ll need to follow the instructions carefully as replacing a core piece of functionality is no small feat!
Upstart is under development with a promise that the upstart “job files” will change format—a subtle hint not to starting using then natively yet. At the same time, upstart is coming along nicely with rumours of interest already having come from the Red Hat and Fedora camp.
Just like all new features in Ubuntu, what has now become upstart has been tracked through out by using ReplacementInit (https://launchpad.net/distros/ubuntu/+spec/replacement-init) entry in Launchpad’s Blueprint component. There you can see pretty diagrams of how other development specifications interact with the work done by upstart.
The core init process gets upgraded once in a generation. Welcome to the future. It’s event-based. It’s dynamic. It’s in the Ubuntu development release.


More... (http://fridge.ubuntu.com/node/535)