Slashdot Mirror


Replacing the Aging Init Procedure on Linux

SmellsLikeTeenGarlic writes "Seth Nickell (of Storage and Gnome HIG fame) has started a new project which aims to replace the aging Init system on Linux. OSNews has more details on the project, directly from Seth. The new Python-based approach will make booting faster and it will talk to the D-BUS daemon, freedesktop.org's leading project. And speaking of freedesktop.org, it is important to mention the release of HAL 0.1, an implementation of a hardware abstraction layer for KDE, XFce and Gnome, based on a proposal by freedesktop.org's founder Havoc Pennington and being implemented by David Zeuthen. It is innovative projects like Storage, SystemServices and HAL that can bring the kind of integration to the underlying system that current X11 desktop environments lack."

25 of 628 comments (clear)

  1. Is it broken enough to need fixing? by ajs318 · · Score: 2, Informative

    The Linux startup process works. Is there any need to muck about with it? On Red Hat et al and Debian, there's the powerful but complicated init.d directory; while Slackware users have a less sophisticated system to contend with.

    And hey, it's not like we have to boot all that often, is it ;-)

    --
    Je fume. Tu fumes. Nous fûmes!
  2. Re:Cool by truthsearch · · Score: 3, Informative

    He plans on implementing one of the key things which will makes systems bring up the user interface faster: launch only those services required by the system to boot, then launch the desktop (if applicable), then continue loading any "secondary" services. For example, the log rotation script found on some distros doesn't need to run before the interface is launched. I think this has been needed for a long time on the Linux desktop. It's worked that way on Windows for a long time.

  3. Another Gentoo feature by Otter · · Score: 4, Informative
    Gentoo has a number of great modifications over traditional Linux distributions that don't get nearly as much hype as the nebulous performance increases from building everything from source.

    The relevant one here is the management of services -- far easier than anything similar I've ever dealt with in the Unix world. I realize that 1) this proposed replacement goes beyond what the Gentoo system manages and 2) real sysadmins running real servers aren't going to leave the existing system any time soon, but for desktop users today, it's a great advance that doesn't get the credit it deserves.

    1. Re:Another Gentoo feature by Chardros · · Score: 2, Informative

      I'm in agreement. I read this a few days ago, when it appeard on footnotes. It talked a lot about dependancies, etc, which the Gentoo init structure already accomplishes well. As a matter of fact, extend the Gentoo init structure SLIGHTLY (to accomidate things like "starting" and "stopping" like this guy is talking about, and pretty names or whatever else you want) and all the information he's looking for could be published in /mnt/.init.d. Accessible by every shell/desktop/scripting service on linux, without the need for the CORBA-wannabe D-BUS stuff. Simple file i/o (fopen(), fread())... ya know... the Unix way.

      Oh well. I'm not preaching the Gentoo way here... I'm simply saying this way should be looked at before starting down the convoluted sounding path the article talks about.

      My $0.02US.

  4. Re:That's a joke, right? by be-fan · · Score: 5, Informative

    What kind of coke are you on?

    1) Shell-scripting being interpreted is not the bottleneck. The bottleneck is all the processes that most init-scripts start at bootup, as well as stuff like hardware detection, waiting for DHCP leases, etc. Besides, Python isn't interpreted like shell-scripts, it runs on a bytecode-VM. And Python is fast enough that RedHat uses it for its GUI tools, and most people can't tell the difference.

    2)KDE has gotten *faster* since 2.0.x. 3.2 is the fastest release since the 1.x series. In the 2.x transition, GNOME got a lot faster, but people didn't notice it as much because GTK 2.x was so much slower.

    --
    A deep unwavering belief is a sure sign you're missing something...
  5. Re:Not very *nix-ish by J.+J.+Ramsey · · Score: 4, Informative

    "His approach isn't very *nix-ish, it is very Windows-ish. It assumes you have a GUI."

    Please read the article again, especially the part where Seth Nickell wrote "I *will* provide a way to boot into a "stripped down console mode" aka "single" for system recovery and backup, and a regular non-graphical boot for servers."

    From what I can tell, SystemServices in and of itself only depends on D-BUS and libc. There are Python bindings for D-BUS, so that may make it easy to write a script for SystemServices using Python, but that's the extent of Python's relationship to SystemServices.

  6. Re:Great idea if it reduces startup times by Theatetus · · Score: 4, Informative

    Hmmm... Windows XP gives me a desktop (somewhat) more quickly than Gentoo does, but I have to wait for about 90 seconds to actually do anything or run a program.

    It's a tortoise-and-hare thing; Windows (and lately Gnome) give you eyecandy early on at the cost of having to wait with what looks like a perfectly functional desktop while the rest of your base loads. That's why I use Windowmaker. Once I get to GDM it's rare that it takes more than 5 seconds to have a desktop with nothing stalling on me. YMMV, and this is fairly OT anyways since once I'm at GDM, init's not automatically loading stuff anymore.

    --
    All's true that is mistrusted
  7. Re:Reinventing the wheel? That's the Linux way!! by Baki · · Score: 2, Informative

    Yes this is a horrible perversion and deviation of UNIX.

    Also, the so called disadvantages of init are void. It looks like he does not understand what init is.

    Init is very simple: the kernel calls a program called "init" as soon as the kernel-part of booting is ready.

    The "normal" init (there is a SYSV and a BSD variant, the SYSV variant being somewhat more complex) only reads a config file /etc/inittab to see what further program it should call. For each runlevel there is such a program.

    Usually these are the init.d/rc shell scripts that sequentially carry out a number of initializations. Often there is a kind of master script such as rc2 (for runlevel 2) that calls further scripts in some order (those are usually in /etc/rc2.d/S*). But all this is just "usual" and could be completely modified without throwing away the standard init system.

    If you want, you can configure inittab to call some multithreaded language to carry out some initializations or start background daemons (yes, a UNIX "service" is a daemon, heretic!) in parallel, speeding up the init process.

    You can also simply use shell scripts instead of threads, but use shell background jobs (&) to do some things in parallel and then wait for each of them afterwards (the shell wait command), so you don't even need some multithreading for speeding up your boot process (the difference between multiple processes versus threads in this context is measured in milliseconds, not really a worthwhile advantage when it comes to boot time).

    In short: it is an insane and heretic idea, that can only be bred by evil plans or by ignorance.

  8. simpleinit by Sharkeys-Day · · Score: 5, Informative

    There already is a better init system: simpleinit. I've worked with it on embedded systems, and it rocks.

    It's dependency-based, so you only start up the services you need. Read all about it.

    Dependancies are a big improvement over runlevels, although you could implement runlevels on top of it.

  9. .hoD:eR by forgotmypassword · · Score: 2, Informative

    Python is not GPL

    "Python is absolutely free, even for commercial use (including resale)"

    http://www.python.org/doc/Copyright.html

  10. Re:Other init alternative by Ann+Elk · · Score: 2, Informative

    Here's one from IBM: Parallelize Linux system services to improve boot speed. It's not so much as "replacement" as an "enhancement" to speed up the boot process. Interestingly, it uses make to manage service dependencies.

  11. Re:That's a joke, right? by Fefe · · Score: 2, Informative

    Oh yes it is. When I log in a user with bash as shell, you can _feel_ the delay while bash and the dynamic libraries of it are loaded. Yes, even on my Athlon XP. Why? Because my init system loads neither glibc nor bash.

    KDE is only faster than 2.x if you disable all the new eye candy that is now available, like translucent menus and the flashy theme stuff. Yes, that's comparing apples and oranges, but it's also comparing the default desktops. Keramik is themed with large pixmaps, the kde 2.x default layout wasn't (or I'm on crack and didn't notice).

  12. DBus project page compromised by jmcneill · · Score: 2, Informative

    Welp, looks like the DBus project page has been compromised -- visiting it contains a link saying 'This file has moved here', the 'here' linking to goatse.cx. Anybody have a mirror of their site?

  13. Been done before by ofgencow · · Score: 4, Informative

    ETLinux replaced init several years ago with an entirely scripted version. Different scripting engine (Tcl instead of Python) and for different reasons (keeping an embedded Linux kernel tiny.)

    Making this happen was that the ETLinux folks ... added Tcl equivalents for some common syscalls and services: sys_dup, sys_exec, sys_fork, sys_kill, sys_nice, sys_pipe, sys_reboot, sys_sync, sys_wait, sys_chmod, sys_umask, sys_mknod, inp, inw, outp, outw, setleds, mount, umount, uudecode, uuencode, time, ifconfig, route, udp. The introduction of these commands allowed the rewrite of the initialization scripts in pure Tcl, avoiding the inclusion of large binary programs.

    More on ETLinux architecture here.

  14. Re:Not Natural by tigga · · Score: 4, Informative
    In this UNIX, God had in his great Divine Scheme begat Emacs and init.

    Oww, gawd!

    Not Emacs, vi!

  15. Re:Not very *nix-ish by nvrrobx · · Score: 5, Informative

    If you RTFA, you'll see this is aimed at desktops with a GUI, which is somewhere that startup time is very important.

    To quote the article:

    "SystemServices has four major goals:
    1) Provide a full services framework (including handling "boot up")
    2) Integrate well with a desktop interface
    3) Start X, and then allow login ASAP
    4) Allow daemon binaries to directly contribute services rather than requiring each distro/vendor to write shell script wrappers"

    Yes, this is very Windows like, but just because it's Windows like does NOT imply it's a bad thing!

    FreeBSD, for example, has relied on Perl being available in the past. Gentoo relies on Python. Relying on a scripting language to provide extensibility is not a bad thing.

    I'll agree that init works well for servers. I love how DB2 installs itself in the inittab, so init makes sure it's always running. This is a good thing.

    Init does not work as well for desktops. My laptop takes incredibly longer to boot Linux than Windows XP. My iPAQ takes a long time to boot Linux, compared to the startup of WinCE. (Yes, I realize that you don't have to restart Linux very often on the iPAQ, but that's not the point)

  16. This is really simple. by Anonymous Coward · · Score: 5, Informative

    Some of you may not have written your own dists, so here is a breif overview of why this is the stupidest thing I have heard in a very long time.

    1) Bootloader straps a kernel
    2) Kernel mounts a filesystem ro, and loads init from it
    3) init forks a single shell
    4) that shell launches everything found in the inittab
    5) that shell then procedes to run your init scripts

    From that shell what you do is up to you.
    In single user {runlevel S/s} you stop at #4, and start from that shell.

    Any other runlevel will be started from that shell. It doesn't matter if your scripts are written in perl, csh, sh, php, tcl or python.
    It doesn't even matter if you write them in a language that you can compile for extra speed.

    99% of your time is in loading the interpreter, and waiting on the daemons themselves.
    sendmail is extremely slow on loadup, so are other apps. Try setting dhcp, and having it time out.
    or RedHat's retarded Kudzu tool.

    Calling those from a faster interpreter, doesn't make them load or run any faster. It never will.

    If you think runlevels aren't important... Try patching a running system sometime.
    -- Sir Ace

    1. Re:This is really simple. by Cid+Highwind · · Score: 2, Informative

      Calling those from a faster interpreter, doesn't make them load or run any faster. It never will

      No, but a slightly smarter init can start them in parallel, so you can be waiting on dhcp, hotplugd, and kudzu all at the same time. That would make things fater.

      If you think runlevels aren't important... Try patching a running system sometime.

      Why bother? Time spent in runlevel 1 is downtime to your clients anyway; from a normal user's perspective, a system in single-user mode might as well be powered off.

      --
      0 1 - just my two bits
  17. Re:D-BUS, and NIH by be-fan · · Score: 2, Informative

    Reasons why CORBA sucks (mostly from the C++ mapping):

    1) The whole distinction between servants, object references, etc, might be nice in whatever fantasy world the standards makers lived on, but its far too complex. A proper standard (POSIX is an excellent example) should scale. Simple things should be simple, and implementation complexity should scale linearly with problem complexity. Objects are a pretty simple idea. CORBA makes them anything but.

    2) The C++ mapping is completely braindead. I'm someone who finds C++ itself to be rather simple and straightforward, and I still can't always get the parameter passing conventions correct. It also doesn't use the STL. Being released in 1994 is no excuse. We're thankfully leaving the stone-age of C++ behind us, and unless the CORBA C++ mapping is updated, it should be one of those relics we leave bhind.

    3) The standard is full of "gee, wouldn't this be nice" features, while missing some very basic conveniences (offering string-representations of error messages in exceptions).

    --
    A deep unwavering belief is a sure sign you're missing something...
  18. Re:D-BUS, and NIH by Saucepan · · Score: 3, Informative
    I like CORBA itself -- I found it fairly easy to work with, and it has the pleasant property that most of the complex features can be ignored (or at the very least papered over) until you need them for something. When you do dig deeper, you'll find that the interfaces for the sophisticated optional services like messaging and distributed transactions are clean, well designed, and fairly well documented.

    But, I'd hesitate to call it easy to use. The standard C++ language bindings in particular are astonishingly bad:

    • they were originally designed long before C++ had standard string and container types and so use char * (with invisible attributes like the const-ness of a pointer controlling vital behaviour like who is responsible for freeing the object) along with their own unique way of dealing with arrays and iterators
    • early CORBA implementors supported either fast-but-dumb pointers or slower-but-safe reference-counted smart pointers, so when the standard finally caught up it standardized both (typename_ptr and typename_var), with predictably disastrous results (crashes or memory leaks if you mix-n-match them, which may be unavoidable if you use third-party libraries)

    The situation is reported to look better from other languages, and I can personally confirm that the Java bindings are a delight to work with by comparison (of course in Java it's even easier to just use RMI).

    As for the wire-level protocol, I have no complaints about IIOP now that it has readable corbaloc: URLs (the CDR marshalling details are still messy but unless you are writing your own ORB they are taken care of for you). I'm actually a bit surprised that IIOP isn't more widely used on the Internet and in the open source world (outside of GNOME of course) -- it's the distributed computing open standard, it interoperates across languages and OSes, it has numerous open-source implementations, and It Just Works(tm).

    Instead we are getting stuff like web services and SOAP, whose wire format is just as incomprehensible to humans (don't kid yourself that XML is easy to read -- have a look at a fully-decked-out SOAP message some day) while using many times as much bandwidth and memory and taking at least ten times as long to parse. (And I say this even though I currently write SOAP gateways for a living.)

  19. Re:Because it can be done by Anonymous Coward · · Score: 4, Informative

    But that doesn't answer the original question -- what exactly is wrong with the current init process that requires a replacement?

    Say you are on an enterprise that uses a DHCP server for the network. Say the DHCP server is down, but people still can boot their desktops and do work with no network connection, so productivity doesn't go to hell while they don't get an IP.

    Now if you're using dhcp clients on your computer, unplug the network wire. Reboot. See it try for minutes to get a dhcp lease before it continues boot. Now think of services that could trigger the same wait.

    Current init: good for servers, not so for desktops.

  20. Re:Why change what isn't broken by Erwos · · Score: 3, Informative

    I don't think Seth's reasoning _ever_ got on this.

    The boot process on Linux is slow. It's one of the few things that seems to be the same about every distribution. Compare boot time on a WinXP box with non-essential services turned off to boot time on a Linux box with non-essential services turned off. WinXP boots a lot faster, at least in my experience. Can the current system be improved enough to compete? At least one person is saying no.

    Seth is proposing a new system that would be faster and have daemons "take care of themselves" without the need for tons of complicated scripts. These are valid and appropriate goals. It's not pushing some sort of desktop agenda (the "GNOME is taking over!" conspiracists amuse me, I must say), or forcing you to run X.

    This doesn't "address the server-side", or so some people claim, but I've seen no reason that you couldn't easily direct text output to console exactly like the current init does. Of course he's addressing the X desktop - because that's the far more complicated problem.

    -Erwos

    --
    Plausible conjecture should not be misrepresented as proof positive.
  21. Look at Mac OS X (SystemStarter) by a1291762 · · Score: 2, Informative

    The SystemStarter process that Mac OS X uses is based on the Next init/rc system which is similar in principle to how FreeBSD does it's init/rc system. Since it's part of Darwin it should be available under a BSD license. I'm sure it could be rewritten to use X rather than WindowServer for it's graphics.

    I think that's a more worthwhile replacement for linux's init/rc system IMHO.

    Link

  22. Mac OS X, NetBSD rc.d, rcNG, and so on by Guy+Harris · · Score: 4, Informative

    As someone else noted (in an article with a link done as text, not as an , and with an extra blank in it), Mac OS X has a possibly-interesting scheme for starting and stopping system services. Here's the section on System Initialization in the Mac OS X online documentation; in particular, look at the Startup Items stuff.

    It's a dependency-based scheme, like at least some of the other proposed system services mechanisms; see the section on adding your own startup items.

    Note also that Boring Old Init isn't itself changed; /etc/rc runs SystemStarter as its last act, and that starts up the system services. SystemStarter can also be used as a command to start, stop, or restart services, so this isn't just a system startup mechanism.

    NetBSD 1.5 and later have a new rc-based system for controlling services; it's also dependency-based. FreeBSD 5.x has rcNG, which is derived from the NetBSD scheme.

    (Note that all of those systems have a BSD-style init, and thus don't have run levels.)

    Those schemes don't address one of Seth's complaints, however - according to his description in his blog, he doesn't like having shell script wrappers doing the configuration, he wants it done in the service's process itself:

    In other news, reshaped SystemServices around the futile, idealistic goal of having daemons contribute the servicesinstead of silly little shell script wrappers in the future. Ever poked through RH's /etc/init.d/ scripts? Its absurd... they do so much stuff in there that should be included in the bloomin' C code. If you need a check for something, just have the program itself do it.... But of course, these programs were designed to be run with lots of magic brittle flags rather than running and situating themselves intelligently.

    (I express no opinion on this one way or the other; if you like or don't like the idea, send bouquets or brickbats to him, not me.)

    Note also that it appears that he is not designing something just for desktops - in particular, he says:

    The boot process: So first the kernel loads itself, and calls ServiceManager (instead of "init"). The ServiceManager starts the DBus service manually,

    and checks to see if it should be doing a graphical bootup. If it should be, it starts the GraphicalLogin service (which of course may have dependencies to start first).

    Now, whether the kernel should start ServiceManager directly, or whether it should continue to run init and have ServiceManager started from an rc file, is another issue; I'm not sure that there's a compelling argument to eliminate init other than to discourage people from continuing to use the current rc script scheme (which might be Seth's motivation for running ServiceManager as process 1 - he might want to discourage rc script tweaking).

    Perhaps one of the reasons why people thought of ServiceManager as being purely for desktop systems is that they thought that, as D-BUS is somewhat associated with freedesktop.

  23. Re:Better init Replacement by Anonymous Coward · · Score: 1, Informative
    "As the installer continued to copy files, its best feature appeared: a Tetris-like game that provided a welcome diversion from a monotonous task."

    Caldera OpenLinux 2.2 -- see the review