Next: , Previous: , Up: Init Process   [Contents][Index]


6.2 Init Process Configuration

The two configuration files are read in this order: /etc/inittab first, then /etc/pies.init. The /etc/inittab file is a simple line-oriented file. Empty lines and lines beginning with ‘#’ are ignored (except if ‘#’ is followed by the word ‘pies’, see below). Non-empty lines consist of 4 fields separated by colons:

id:runlevels:mode:command

where

id

Component identifier. A string uniquely identifying this component.

runlevels

List of the runlevels for which the component should be run. Runlevels are listed as a contiguous string of characters, without any whitespace or delimiters.

mode

Component execution mode.

command

Command to be executed and its arguments.

Component execution modes are:

respawn

The basic execution mode. A respawn component is restarted each time it terminates. If it is restarted more than 10 times in 2 minutes, pies puts it in sleeping state for the next 5 minutes.

off

Disabled component. The entry is ignored.

boot

The process will be executed during system boot. The ‘runlevel’ settings are ignored.

bootwait

The process will be executed during system boot. No other components will be started until it has terminated. The ‘runlevel’ settings are ignored.

sysinit

The process will be executed during system boot, before any boot or bootwait entries. The ‘runlevel’ settings are ignored.

once

The process will be executed once when the specified runlevel is entered.

wait

The process will be started once when the specified runlevel is entered. Pies will wait for its termination before starting any other processes.

ctrlaltdel

The process will be executed when pies receives the SIGINT signal. Normally this means that the CTRL-ALT-DEL combination has been pressed on the keyboard.

kbrequest

The process will be executed when a signal from the keyboard handler is received that indicates that a special key combination was pressed on the console keyboard.

ondemand

The process will be executed when the specified ondemand runlevel is called (‘a’, ‘b’ and ‘c’). No real runlevel change will occur (see Ondemand runlevels). The process will remain running across any eventual runlevel changes and will be restarted whenever it terminates, similarly to respawn components.

powerfail

The process will be executed when the power goes down. Pies will not wait for the process to finish.

powerfailnow

The process will be executed when the power is failing and the battery of the external UPS is almost empty.

powerokwait

The process will be executed as soon as pies is informed that the power has been restored.

powerwait

The process will be executed when the power goes down. Pies will wait for the process to finish before continuing.

The special mode ‘initdefault’ declares the default runlevel. In the ‘initdefault’ entry, the runlevels field must consist of exactly one runlevel character. Rest of fields are ignored. For example, the following instructs pies that the default runlevel is ‘3’:

id:3:initdefault:

If no ‘initdefault’ entry is present, pies will ask the user to input the desired default runlevel upon entering the normal state.

Inittab must contain at least one entry with ‘S’ in runlevels field. This entry is used for system maintenance and recovery. If it is absent, pies adds the following default entry implicitly:

~~:S:wait:/sbin/sulogin

As an exception to traditional syntax, the ‘#’ followed by the word ‘pies’ (with any amount of white space in between) introduce a pragmatic comment that modifies the behavior of the configuration parser. The following such comments are understood:

#pies pragma debug n

Set debugging level n (a decimal number). See Pies Debugging.

#pies pragma next syntax file

After parsing /etc/inittab, read configuration from file file, assuming syntax (see config syntax). Multiple ‘next’ pragmas are allowed, the named files will be processed in turn.

The default set up is equivalent to specifying

#pies pragma next pies /etc/pies.init
#pies pragma stop

Stop parsing after this line. The remaining material is ignored.

Both the traditional /etc/inittab and pies-native /etc/pies.init files are entirely equivalent, excepting that, naturally, the latter is more flexible and gives much more possibilities in defining the system behavior. The declaration of a component in /etc/pies.init can contain all the statements discussed in Component Statement. The only difference is that runlevels to start the component is must be specified:

Config: component: runlevels string

Specifies the runlevel to start the component in. The string argument is a string of runlevel characters.

For example, the inittab entry discussed above is equivalent to the following statement in pies.init file:

component id {
  mode mode;
  runlevels runlevels;
  command command;
}

The default runlevel is specified in /etc/pies.init using the following construct:

Config: initdefault rl

Declare the default runlevel. The argument is the runlevel name. E.g.

initdefault 3;

If both /etc/inittab and /etc/pies.init are present, the latter can declare components with the same id as the ones declared in the former. In that case, the two entries will be merged, the latter one overriding the former. Thus, /etc/pies.init can be used to complement definitions in inittab. Consider, for example the following inittab entry:

upd:3:respawn:/usr/libexec/upload

If pies.init contains the following:

component upd {
    user nobody;
    stderr syslog local1;
}    

the result will be equivalent to:

component upd {
    mode respawn;
    runlevels 3;
    command /usr/libexec/upload;
    user nobody;
    stderr syslog local1;
}    

Next: , Previous: , Up: Init Process   [Contents][Index]