Next: , Previous: , Up: Top   [Contents][Index]


6 Init – parent of all processes

Pies can be executed directly by the kernel as a program responsible for starting all other processes (a process with PID 1). In this case it becomes also the parent of all processes whose natural parents have died and is responsible for reaping those when they die.

When invoked this way, pies reads its configuration from two files: /etc/inittab and /etc/pies.init. The former has traditional syntax (see inittab) and is retained for compatibility with another ‘init’ daemons, and the latter is in native pies format (see Syntax). Either of the files or even both of them can be missing.

The startup process passes through several states. Transition between states is controlled by runlevel, which also defines the set of components that must be executed. Startup states are:

sysinit

System initialization state. This state marks the beginning of the startup process. Only root partition is mounted, and is usually read-only. Pies uses console to output diagnostic messages.

Normally, the configuration instructs pies to execute at this point the system initialization script, which checks and mounts the necessary local file systems, initializes devices and loads kernel modules.

The system then passes to ‘boot’ state, unless the default runlevel is ‘S’, in which case the ‘single’ state is selected.

boot

Upon entering the ‘boot’ state, pies attempts to log the ‘reboot’ login record into the system utmp/wtmp files and executes entries marked with boot and bootwait types. It then enters the ‘normal’ state.

single

This is a fallback state for single-user system. It is entered only if the ‘S’ runlevel has been selected initially. Normally, this state is used for system maintenance. The configuration usually provides a component which executes a single-user shell when entering this state. If it does not, pies executes ‘/sbin/sulogin’.

normal

Upon entering this state, pies assumes that components executed previously have brought the system to such condition where normal communication means can already be used. This means that the file systems have been mounted read-write and the syslog daemon is operating. Therefore pies opens its communication channels and redirects its diagnostic output to syslog facility ‘daemon’.

Then it starts components scheduled for the default runlevel and begins its normal operation.

Pies communication channels are:

/dev/initctl

A FIFO file for communication using legacy protocol (using telinit).

/dev/init.ctl

UNIX socket for communication using piesctl.


Next: , Previous: , Up: Top   [Contents][Index]