Alex Daniloff wrote:
Hello SuSE folkz, I have some questions regarding properties of SysV init daemon. It starts on a system boot up by the kernel call to /sbin/init. Then init reads /etc/inittab and starts/stops services in /etc/inint.d After system has booted into default run level (e.g 5) init still continues to run as a daemon. Does it have any other purposes other than idling in the loop with uid 1 and gid 0? Isn't it right that kernel itself takes care about parent processes and its children? Why do we need init running as a daemon after a system is running in default runlevel? I can start and stop any service without init involved. Could somebody please give me a pointer to the source of information regarding all properties of init.
The way I understand it: The kernel can be used in two ways. Initially, it's job (greatly simplified) is hardware initialization. Then, when that is complete, it enlists 'init' (in user space) to be the captain of the ship and becomes more of a service provider via system calls. The kernel still runs of course, but all its work is done in kernel space. All processes are children of init. If init dies, the system goes down. In other words, in the beginning there is only the kernel working in kernel space init. Then, when things are sufficiently set up for user space, init is spawned as the parent of all user space processes and the kernel stays on for kernel related tasks (memory management, process scheduling, I/O, low level stuff). Linux uses a parent/child relationship for all processes. Processes exist in user space. The kernel does not have a user space presence. Therefore, a process must exist to be the parent of all. Init is that process. People will correct me if I am wrong :-) Hopefully it's not too far from the truth since I said the same thing 3 times in as many paragraphs. HTH, BR