LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   init (https://www.linuxquestions.org/questions/linux-newbie-8/init-669546/)

lipun4u 09-12-2008 03:26 PM

init
 
After booting, kernel passes control over to /sbin/init .



What is this /sbin/init ???

darthaxul 09-12-2008 03:29 PM

the mother of all processes

jailbait 09-12-2008 03:31 PM

init is a program which starts all your processes. There is a longer explanation in the man pages. See:

man init

Here is another explanation of what init does:

http://tldp.org/LDP/sag/html/init-intro.html

--------------------
Steve Stites

Mr. C. 09-13-2008 12:47 AM

The kernel gives birth to init, and init gives birth to the first processes, including those that accept your login and shell creation. And init will reap the corpses of dead children left behind by uncaring parents.

i92guboj 09-13-2008 01:08 AM

Another one.

First, it comes the bootloader, usually grub or lilo in pc architectures. The bootloader is not linux yet, it's outside the OS.

The bootloader loads a kernel, this kernel boots and gives life to all your hardware, making it accesible for the rest of the system.

Once that is done, the kernel calls the init process, that process starts the basic services, including those that allows you to login in your machine. After that, you have the control.

Init is the first process that's started in linux, it always has the PID number 1. The rest of them are its descendants in one or another way.

lipun4u 09-13-2008 01:36 AM

U did some research and found that after init, following scripts are executed..

1. /etc/rc.d/rc.sysinit (to set up script environment)
2. /etc/inittab (to run default run level)
3. /etc/rc.d/init.d/functions (to run various start up functions)


is that true ????is anything missing ???/

Mr. C. 09-13-2008 02:46 AM

The init process reads /etc/inittab to determine which processes to start. The scripts in rc.d are called in response to the contents of /etc/inittab and are invoked based on the init run level

lipun4u 09-13-2008 06:01 AM

is that mean...init process executes and reads the files specified in step 1,2 and 3 ???

pixellany 09-13-2008 08:46 AM

Quote:

Originally Posted by lipun4u (Post 3279132)
is that mean...init process executes and reads the files specified in step 1,2 and 3 ???

No--that's not what he said.
init first looks at /etc/inittab. based on what it finds there, it goes on to run other scripts.

BUT---what about systems that don't use inittab?

To really get to the bottom of this, you could look at the source code for init....Here is a link for SysVinit:
http://freshmeat.net/projects/sysvinit/

i92guboj 09-13-2008 09:58 AM

People above describe a tipical sysV init system. But don't forget that, even if it's the most broadly used init system, sysV init is not the-one-and-only.

There are many init systems besides sysV alikes. BSD-like init systems are used in lots of distros, and some newer ones like einit or initng. Some other distros, like Gentoo, have their own init systems.

Most of them vary on the implementation details, though really most of them are configured in a very similar way. The bigger differences in which regards administration usually are on the way that runlevels are implemented, but it really depends on what init systems you want to compare.


All times are GMT -5. The time now is 08:44 AM.