Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I already know that init is the magical program that is needed for booting your computer and managing runlevels, but what is it's real purpose?

Why do we even need init in the first place? Why can't the bootloader tell Upstart what programs to run and not run?

This question in (late) response to my What would happen if init was deleted? question.

share|improve this question
    
init is the mother of all processes. –  richard Aug 25 at 11:20
    
It is easier to write the functionality of init as a user process than to write it in the kernel. If it where written in the kernel, then someone would add a process starter that would run in user space, that is more flexible. Thus duplicating the functionality. Therefore it is best to keep the kernel part as simple as possible. –  richard Aug 25 at 11:21
    
man init > "What does init on Ubuntu do" and read it in home folder –  KasiyA Aug 26 at 6:05

2 Answers 2

up vote 6 down vote accepted

See the manual for init on Unix systems.

This is a post from the Wikipedia entry on init:

In Unix-based computer operating systems, init (short for initialization) is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shut down. It is the direct or indirect ancestor of all other processes and automatically adopts all orphaned processes. Init is started by the kernel using a hard-coded filename, and if the kernel is unable to start it, a kernel panic will result. Init is typically assigned process identifier 1.

The design of init has diverged in Unix systems such as System III and System V, from the functionality provided by the init in Research Unix and its BSD derivatives. The usage on most Linux distributions is somewhat compatible with System V, but some distributions, such as Slackware, use a BSD-style and others, such as Gentoo, have their own customized version.

Several replacement init implementations have been written with attempt to address design limitations in the standard versions. These include launchd, the Service Management Facility, systemd and Upstart, the latter being used by Ubuntu and some other Linux distributions.

Hope this helps to explain it to you; it’s a lot of reading.

share|improve this answer
    
Answer accepted once this bug is fixed. –  Whaaaaaat Aug 28 at 18:01
    
What bug do you mean ? –  mark kirby Aug 28 at 18:06
    
AU had a bug... –  Whaaaaaat Aug 28 at 19:07

upstart and systemd are init systems. By convention (and perhaps other constraints), the program is still called init, irrespective of whether systemd or upstart or something else is at play. Don't let the process name fool you. PID1 is not SysV init any longer. It hasn't been for quite some time on Ubuntu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.